Compile Error

foo.cc: In function ‘bool cmp(Node, Node)’:
foo.cc:9:41: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    9 |         return x.num<y.num||x.num==y.num&&x.id<y.id;
      |                             ~~~~~~~~~~~~^~~~~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:26:33: error: no match for ‘operator=’ (operand types are ‘Node’ and ‘int’)
   26 |                         a[t[x]]=v;
      |                                 ^
foo.cc:3:8: note: candidate: ‘Node& Node::operator=(const Node&)’
    3 | struct Node{
      |        ^~~~
foo.cc:3:8: note:   no known conversion for argument 1 from ‘int’ to ‘const Node&’
foo.cc:3:8: note: candidate: ‘Node& Node::operator=(Node&&)’
foo.cc:3:8: note:   no known conversion for argument 1 from ‘int’ to ‘Node&&’

信息

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