Compile Error

foo.cc: In function ‘bool cmp(Node, Node)’:
foo.cc:41:37: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
   41 |     return x.num<y.num||x.num==y.num&&x.id<y.id;
      |                         ~~~~~~~~~~~~^~~~~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:45:9: error: no matching function for call to ‘read(int&)’
   45 |     read(n);
      |     ~~~~^~~
In file included from /nix/glibc-2.40-66-dev/include/bits/sigstksz.h:24,
                 from /nix/glibc-2.40-66-dev/include/signal.h:328,
                 from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/csignal:42,
                 from stdc++.h:116:
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note: candidate: ‘ssize_t read(int, void*, size_t)’
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note:   candidate expects 3 arguments, 1 provided
foo.cc:3:12: note: candidate: ‘int read()’
    3 | inline int read()
      |            ^~~~
foo.cc:3:12: note:   candidate expects 0 arguments, 1 provided
foo.cc:46:13: error: no matching function for call to ‘read(int&)’
   46 |         read(q);
      |         ~~~~^~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note: candidate: ‘ssize_t read(int, void*, size_t)’
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note:   candidate expects 3 arguments, 1 provided
foo.cc:3:12: note: candidate: ‘int read()’
    3 | inline int read()
      |            ^~~~
foo.cc:3:12: note:   candidate expects 0 arguments, 1 provided
foo.cc:49:13: error: no matching function for call to ‘read(int&)’
   49 |         read(a[i].num);
      |         ~~~~^~~~~~~~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note: candidate: ‘ssize_t read(int, void*, size_t)’
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note:   candidate expects 3 arguments, 1 provided
foo.cc:3:12: note: candidate: ‘int read()’
    3 | inline int read()
      |            ^~~~
foo.cc:3:12: note:   candidate expects 0 arguments, 1 provided
foo.cc:56:13: error: no matching function for call to ‘read(int&)’
   56 |         read(p);
      |         ~~~~^~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note: candidate: ‘ssize_t read(int, void*, size_t)’
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note:   candidate expects 3 arguments, 1 provided
foo.cc:3:12: note: candidate: ‘int read()’
    3 | inline int read()
      |            ^~~~
foo.cc:3:12: note:   candidate expects 0 arguments, 1 provided
foo.cc:57:21: error: no matching function for call to ‘read(int&)’
   57 |                 read(x);
      |                 ~~~~^~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note: candidate: ‘ssize_t read(int, void*, size_t)’
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note:   candidate expects 3 arguments, 1 provided
foo.cc:3:12: note: candidate: ‘int read()’
    3 | inline int read()
      |            ^~~~
foo.cc:3:12: note:   candidate expects 0 arguments, 1 provided
foo.cc:61:17: error: no matching function for call to ‘read(int&)’
   61 |             read(v);
      |             ~~~~^~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note: candidate: ‘ssize_t read(int, void*, size_t)’
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
/nix/glibc-2.40-66-dev/include/unistd.h:371:16: note:   candidate expects 3 arguments, 1 provided
foo.cc:3:12: note: candidate: ‘int read()’
    3 | inline int read()
      |            ^~~~
foo.cc:3:12: note:   candidate expects 0 arguments, 1 provided

信息

递交者
类型
递交
题目
P2433 插入排序
语言
C++
递交时间
2025-07-18 16:12:58
评测时间
2025-07-18 16:12:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes