/ Vijos /

记录详情

Compile Error

foo.cc: In function 'void addedge(int, int, int)':
foo.cc:34:63: error: reference to 'next' is ambiguous
 void addedge(int u,int v,int w){edge[++size]=v;weight[size]=w;next[size]=pre[u],pre[u]=size;}
                                                               ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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: In function 'void dfs_down(int)':
foo.cc:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:40:2: note: in expansion of macro 'Forp'
  Forp(x)
  ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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: In function 'void dfs_up(int)':
foo.cc:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:55:2: note: in expansion of macro 'Forp'
  Forp(x)
  ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:64:2: note: in expansion of macro 'Forp'
  Forp(x)
  ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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: In function 'void find_circle(int)':
foo.cc:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:89:2: note: in expansion of macro 'Forp'
  Forp(x)
  ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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: In function 'void circle_down()':
foo.cc:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:117:3: note: in expansion of macro 'Forp'
   Forp(x)
   ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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:116:6: warning: unused variable 'sum' [-Wunused-variable]
   ld sum=0.0;
      ^~~
foo.cc: In function 'void circle_up()':
foo.cc:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:157:3: note: in expansion of macro 'Forp'
   Forp(x)
   ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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:17:38: error: reference to 'next' is ambiguous
 #define Forp(x) for(int p=pre[x];p;p=next[p])
                                      ^
foo.cc:165:3: note: in expansion of macro 'Forp'
   Forp(x)
   ^~~~
foo.cc:33:34: note: candidates are: int next [300010]
 int n,m,edge[MAXM],pre[MAXN]={0},next[MAXM]={0},weight[MAXM],size=0;
                                  ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/algorithm:61,
                 from foo.cc:4:
/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: In function 'int main()':
foo.cc:14:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define Rep(i,n) for(int i=0;i<n;i++)
foo.cc:215:7:
   Rep(i,q.size()) b[q[i]]=1;
       ~~~~~~~~~~               
foo.cc:215:3: note: in expansion of macro 'Rep'
   Rep(i,q.size()) b[q[i]]=1;
   ^~~
foo.cc:184: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:188:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d",&u,&v,&w);
   ~~~~~^~~~~~~~~~~~~~~~~~~
正在同步测试数据,请稍后
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
递交
题目
P1807 迷失游乐园
语言
C++
递交时间
2021-02-25 23:41:25
评测时间
2021-02-25 23:41:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes