/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void insert(int, int)':
/in/foo.cc:22:63: error: reference to 'prev' is ambiguous
 inline void insert(int u,int v) {   e[++top].to=v;e[top].next=prev[u];prev[u]=&e[top];  }
                                                               ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc:22:71: error: reference to 'prev' is ambiguous
 inline void insert(int u,int v) {   e[++top].to=v;e[top].next=prev[u];prev[u]=&e[top];  }
                                                                       ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc: In function 'void solve_3()':
/in/foo.cc:30:27: error: reference to 'prev' is ambiguous
     for (register edge *i=prev[x];i;i=i->next)   for (register edge *j=prev[i->to];j;j=j->next)
                           ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc:30:72: error: reference to 'prev' is ambiguous
     for (register edge *i=prev[x];i;i=i->next)   for (register edge *j=prev[i->to];j;j=j->next)
                                                                        ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc: In function 'void solve_4()':
/in/foo.cc:36:31: error: reference to 'prev' is ambiguous
         for (register edge *I=prev[i];I;I=I->next)
                               ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc:38:39: error: reference to 'prev' is ambiguous
                 for (register edge *J=prev[j];J;J=J->next)
                                       ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc: In function 'void solve_5()':
/in/foo.cc:45:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
         for (int k=1;k<=n;++k)   cnt[k]=0;sum=0;
         ^~~
/in/foo.cc:45:43: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
         for (int k=1;k<=n;++k)   cnt[k]=0;sum=0;
                                           ^~~
/in/foo.cc:46:31: error: reference to 'prev' is ambiguous
         for (register edge *I=prev[i];I;I=I->next)   if (I->to!=j&&a[I->to][j])    ++cnt[I->to],++sum;
                               ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator, typename std::iterator_traits<_Iter>::difference_type)
     prev(_BidirectionalIterator __x, typename
     ^~~~
/in/foo.cc:47:31: error: reference to 'prev' is ambiguous
         for (register edge *I=prev[i];I;I=I->next)
                               ^~~~
/in/foo.cc:21:47: note: candidates are: edge* prev [1010]
 struct edge {   int to; edge *next; }e[MAXM],*prev[MAXN];
                                               ^~~~
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 /in/foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:220:5: note:                 template<class _BidirectionalIterator> _BidirectionalIterator std::prev(_BidirectionalIterator,

信息

递交者
类型
递交
题目
P1959 旅行计划
语言
C++
递交时间
2018-11-04 16:20:36
评测时间
2018-11-04 16:20:36
评测机
分数
0
总耗时
368ms
峰值内存
41.555 MiB