/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int is_Safe(int, int)':
/in/foo.cc:20:11: error: reference to 'next' is ambiguous
      tx=x+next[k][0];
           ^~~~
/in/foo.cc:11:5: note: candidates are: int next [4][2]
 int next[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
     ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:21:11: error: reference to 'next' is ambiguous
      ty=y+next[k][1];
           ^~~~
/in/foo.cc:11:5: note: candidates are: int next [4][2]
 int next[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
     ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:45:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    if(map[tx][ty]=='0'&&book[tx][ty]==0&&is_Safe(tx,ty))
    ^~
/in/foo.cc:47:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      book[1][1]=1;
      ^~~~
/in/foo.cc:52:21: error: reference to 'next' is ambiguous
      tx=que[head].x+next[k][0];
                     ^~~~
/in/foo.cc:11:5: note: candidates are: int next [4][2]
 int next[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
     ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:53:21: error: reference to 'next' is ambiguous
      ty=que[head].y+next[k][1];
                     ^~~~
/in/foo.cc:11:5: note: candidates are: int next [4][2]
 int next[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
     ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~

信息

递交者
类型
递交
题目
P1294 拯救OIBH总部
语言
C++
递交时间
2017-11-10 16:25:48
评测时间
2017-11-10 16:25:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes