/ Vijos /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:21:16: error: reference to 'next' is ambiguous
    tx=que[h].x+next[i][0];
                ^~~~
foo.cc:6:15: note: candidates are: int next [5][2]
 int x,x2,y,y2,next[5][2]={{0,0},{1,-2},{2,-1},{2,1},{1,2}};
               ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
foo.cc:22:16: error: reference to 'next' is ambiguous
    ty=que[h].y+next[i][1];
                ^~~~
foo.cc:6:15: note: candidates are: int next [5][2]
 int x,x2,y,y2,next[5][2]={{0,0},{1,-2},{2,-1},{2,1},{1,2}};
               ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
foo.cc:12:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
foo.cc:13:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&x,&y);
  ~~~~~^~~~~~~~~~~~~~~
foo.cc:14:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&x2,&y2);
  ~~~~~^~~~~~~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
递交
题目
P1187 兵分N路
语言
C++
递交时间
2021-05-16 14:31:11
评测时间
2021-05-16 14:31:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes