/ WHOJ /

记录详情

Compile Error

foo.cc: In function 'void link(int, int)':
foo.cc:6:2: error: reference to 'right' is ambiguous
    6 |  right[L]=R,left[R]=L;
      |  ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:6:13: error: reference to 'left' is ambiguous
    6 |  right[L]=R,left[R]=L;
      |             ^~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1011:3: note: candidates are: 'std::ios_base& std::left(std::ios_base&)'
 1011 |   left(ios_base& __base)
      |   ^~~~
foo.cc:3:7: note:                 'int left [100005]'
    3 | int n,left[100005],right[100005];
      |       ^~~~
foo.cc: In function 'int main()':
foo.cc:17:4: error: reference to 'left' is ambiguous
   17 |    left[i]=i-1;
      |    ^~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1011:3: note: candidates are: 'std::ios_base& std::left(std::ios_base&)'
 1011 |   left(ios_base& __base)
      |   ^~~~
foo.cc:3:7: note:                 'int left [100005]'
    3 | int n,left[100005],right[100005];
      |       ^~~~
foo.cc:18:4: error: reference to 'right' is ambiguous
   18 |    right[i]=(i+1)%(n+1);
      |    ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:20:3: error: reference to 'right' is ambiguous
   20 |   right[0] = 1;
      |   ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:21:3: error: reference to 'left' is ambiguous
   21 |   left[0] = n;
      |   ^~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1011:3: note: candidates are: 'std::ios_base& std::left(std::ios_base&)'
 1011 |   left(ios_base& __base)
      |   ^~~~
foo.cc:3:7: note:                 'int left [100005]'
    3 | int n,left[100005],right[100005];
      |       ^~~~
foo.cc:30:19: error: reference to 'right' is ambiguous
   30 |     if(op == 3 && right[Y] == X) swap(X, Y);
      |                   ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:32:24: error: reference to 'left' is ambiguous
   32 |     if(op == 1 && X == left[Y]) continue;
      |                        ^~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1011:3: note: candidates are: 'std::ios_base& std::left(std::ios_base&)'
 1011 |   left(ios_base& __base)
      |   ^~~~
foo.cc:3:7: note:                 'int left [100005]'
    3 | int n,left[100005],right[100005];
      |       ^~~~
foo.cc:33:24: error: reference to 'right' is ambiguous
   33 |     if(op == 2 && X == right[Y]) continue;
      |                        ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:35:14: error: reference to 'left' is ambiguous
   35 |     int LX = left[X], RX = right[X], LY = left[Y], RY = right[Y];
      |              ^~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1011:3: note: candidates are: 'std::ios_base& std::left(std::ios_base&)'
 1011 |   left(ios_base& __base)
      |   ^~~~
foo.cc:3:7: note:                 'int left [100005]'
    3 | int n,left[100005],right[100005];
      |       ^~~~
foo.cc:38:15: error: 'RX' was not declared in this scope; did you mean 'LX'?
   38 |      link(LX, RX);
      |               ^~
      |               LX
foo.cc:39:11: error: 'LY' was not declared in this scope; did you mean 'LX'?
   39 |      link(LY, X);
      |           ^~
      |           LX
foo.cc:44:15: error: 'RX' was not declared in this scope; did you mean 'LX'?
   44 |      link(LX, RX);
      |               ^~
      |               LX
foo.cc:46:14: error: 'RY' was not declared in this scope; did you mean 'Y'?
   46 |      link(X, RY);
      |              ^~
      |              Y
foo.cc:50:9: error: reference to 'right' is ambiguous
   50 |      if(right[X] == Y)
      |         ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:54:15: error: 'RY' was not declared in this scope; did you mean 'Y'?
   54 |       link(X, RY);
      |               ^~
      |               Y
foo.cc:59:15: error: 'RX' was not declared in this scope; did you mean 'LX'?
   59 |       link(Y, RX);
      |               ^~
      |               LX
foo.cc:60:12: error: 'LY' was not declared in this scope; did you mean 'LX'?
   60 |       link(LY, X);
      |            ^~
      |            LX
foo.cc:61:15: error: 'RY' was not declared in this scope; did you mean 'Y'?
   61 |       link(X, RY);
      |               ^~
      |               Y
foo.cc:71:8: error: reference to 'right' is ambiguous
   71 |    b = right[b];
      |        ^~~~~
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/ios_base.h:1019:3: note: candidates are: 'std::ios_base& std::right(std::ios_base&)'
 1019 |   right(ios_base& __base)
      |   ^~~~~
foo.cc:3:20: note:                 'int right [100005]'
    3 | int n,left[100005],right[100005];
      |                    ^~~~~
foo.cc:10:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   10 |  freopen("boxline.in","r",stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:11:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   11 |  freopen("boxline.out","w",stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:25:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   25 |    scanf("%d", &op);
      |    ~~~~~^~~~~~~~~~~
foo.cc:29:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   29 |     scanf("%d%d", &X, &Y);
      |     ~~~~~^~~~~~~~~~~~~~~~
正在同步测试数据,请稍后
Found 10 testcases.
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1275 移动盒子
题目数据
下载
语言
C++
递交时间
2022-07-10 17:40:33
评测时间
2022-07-10 17:40:33
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes