/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int right_ratote(node*&)':
foo.cc:28:12: error: request for member 'size' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   28 | int s0=(t).size,s1=((*(t).left_child).right_child).size;
      |            ^~~~
foo.cc:29:26: error: request for member 'size' in 't->node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   29 | int s2=((*t).left_child).size;
      |                          ^~~~
foo.cc:32:12: error: 's1' was not declared in this scope; did you mean 's2'?
   32 | (*t).size+=s1;
      |            ^~
      |            s2
foo.cc:34:5: error: request for member 'left_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   34 | (t).left_child=((*t).left_child).right_child;
      |     ^~~~~~~~~~
foo.cc:34:34: error: request for member 'right_child' in 't->node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   34 | (t).left_child=((*t).left_child).right_child;
      |                                  ^~~~~~~~~~~
foo.cc:35:5: error: request for member 's' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   35 | (t).s=((t).left_child).s+((*t).right_child).s+1;
      |     ^
foo.cc:35:12: error: request for member 'left_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   35 | (t).s=((t).left_child).s+((*t).right_child).s+1;
      |            ^~~~~~~~~~
foo.cc:35:45: error: request for member 's' in 't->node::right_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   35 | (t).s=((t).left_child).s+((*t).right_child).s+1;
      |                                             ^
foo.cc:37:12: error: request for member 's' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   37 | (*k).s=(t).s+((*k).left_child).s+1;
      |            ^
foo.cc:37:32: error: request for member 's' in 'k->node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   37 | (*k).s=(t).s+((*k).left_child).s+1;
      |                                ^
foo.cc: In function 'int left_ratote(node*&)':
foo.cc:47:5: error: request for member 'size' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   47 | (t).size+=((*k).left_child).size;
      |     ^~~~
foo.cc:47:29: error: request for member 'size' in 'k->node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   47 | (t).size+=((*k).left_child).size;
      |                             ^~~~
foo.cc:49:5: error: request for member 's' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   49 | (t).s=((t).left_child).s+((*t).right_child).s+1;
      |     ^
foo.cc:49:12: error: request for member 'left_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   49 | (t).s=((t).left_child).s+((*t).right_child).s+1;
      |            ^~~~~~~~~~
foo.cc:49:45: error: request for member 's' in 't->node::right_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   49 | (t).s=((t).left_child).s+((*t).right_child).s+1;
      |                                             ^
foo.cc:51:12: error: request for member 's' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   51 | (*k).s=(t).s+((*k).right_child).s+1;
      |            ^
foo.cc:51:33: error: request for member 's' in 'k->node::right_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   51 | (*k).s=(t).s+((*k).right_child).s+1;
      |                                 ^
foo.cc: In function 'int maintain(node*&)':
foo.cc:57:11: error: request for member 'left_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   57 | if ((((t).left_child).left_child).s>((*t).right_child).s){
      |           ^~~~~~~~~~
foo.cc:57:56: error: request for member 's' in 't->node::right_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   57 | if ((((t).left_child).left_child).s>((*t).right_child).s){
      |                                                        ^
foo.cc:59:14: error: request for member 'right_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   59 | maintain((t).right_child);
      |              ^~~~~~~~~~~
foo.cc:63:12: error: request for member 'right_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   63 | if (((*(t).right_child).right_child).s>((*t).left_child).s){
      |            ^~~~~~~~~~~
foo.cc:63:58: error: request for member 's' in 't->node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   63 | if (((*(t).right_child).right_child).s>((*t).left_child).s){
      |                                                          ^
foo.cc:65:14: error: request for member 'left_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   65 | maintain((t).left_child);
      |              ^~~~~~~~~~
foo.cc:69:12: error: request for member 'left_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   69 | if (((*(t).left_child).right_child).s>((*t).right_child).s){
      |            ^~~~~~~~~~
foo.cc:69:58: error: request for member 's' in 't->node::right_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   69 | if (((*(t).left_child).right_child).s>((*t).right_child).s){
      |                                                          ^
foo.cc:73:14: error: request for member 'right_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   73 | maintain((t).right_child);
      |              ^~~~~~~~~~~
foo.cc:77:12: error: request for member 'right_child' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   77 | if (((*(t).right_child).left_child).s>((*t).left_child).s){
      |            ^~~~~~~~~~~
foo.cc:77:57: error: request for member 's' in 't->node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   77 | if (((*(t).right_child).left_child).s>((*t).left_child).s){
      |                                                         ^
foo.cc: In function 'int INSERT(int, int, node*&)':
foo.cc:94:5: error: request for member 'rank' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   94 | (t).rank=new(saver);
      |     ^~~~
foo.cc:95:6: error: request for member 'rank' in 't', which is of pointer type 'node*' (maybe you meant to use '->' ?)
   95 | ((t).rank).next=NULL;
      |      ^~~~
foo.cc:96:13: error: request for member 'v' in 't->node::rank', which is of pointer type 'saver*' (maybe you meant to use '->' ?)
   96 | ((*t).rank).v=rank;
      |             ^
foo.cc: In function 'node* SELECT(int, node)':
foo.cc:121:9: error: no match for 'operator*' (operand type is 'node')
  121 | if (x>((*t).right_child).size&&x<=(t).size-((t).left_child).size){
      |         ^~
foo.cc:121:61: error: request for member 'size' in 't.node::left_child', which is of pointer type 'node*' (maybe you meant to use '->' ?)
  121 | if (x>((*t).right_child).size&&x<=(t).size-((t).left_child).size){
      |                                                             ^~~~
foo.cc:122:8: error: cannot convert 'node' to 'node*' in return
  122 | return t;
      |        ^
foo.cc:124:10: error: no match for 'operator*' (operand type is 'node')
  124 | if (x<=((*t).right_child).size){
      |          ^~
foo.cc:125:18: error: no match for 'operator*' (operand type is 'node')
  125 | return SELECT(x,(*t).right_child);
      |                  ^~
foo.cc:127:29: error: no match for 'operator*' (operand type is 'node')
  127 | return SELECT(x-((t).size-((*t).left_child).size),(*t).left_child);
      |                             ^~
foo.cc:127:52: error: no match for 'operator*' (operand type is 'node')
  127 | return SELECT(x-((t).size-((*t).left_child).size),(*t).left_child);
      |                                                    ^~
foo.cc: In function 'int main()':
foo.cc:149:18: error: could not convert 'roof' from 'node*' to 'node'
  149 | node *p=SELECT(n,roof);
      |                  ^~~~
      |                  |
      |                  node*
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1647 不差钱
语言
C++
递交时间
2023-07-16 12:59:19
评测时间
2023-07-16 12:59:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes