QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#103503#2827. AutobiographyMaMengQiCompile Error//C++1.1kb2023-05-06 13:19:422023-05-06 13:19:43

详细

answer.code: In function ‘void addedge(int, int)’:
answer.code:16:9: error: reference to ‘next’ is ambiguous
   16 |         next[tot]=first[a];first[a]=tot;
      |         ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: ‘template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)’
  213 |     next(_InputIterator __x, typename
      |     ^~~~
answer.code:12:17: note:                 ‘int next [400010]’
   12 | int first[maxn],next[maxm*2],tot;
      |                 ^~~~
answer.code: In function ‘int dfs(int, int)’:
answer.code:24:32: error: reference to ‘next’ is ambiguous
   24 |         for(int i=first[x];i;i=next[i]){
      |                                ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: ‘template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)’
  213 |     next(_InputIterator __x, typename
      |     ^~~~
answer.code:12:17: note:                 ‘int next [400010]’
   12 | int first[maxn],next[maxm*2],tot;
      |                 ^~~~
answer.code: In function ‘int main()’:
answer.code:44:24: error: reference to ‘next’ is ambiguous
   44 |                 memset(next,0,sizeof next);
      |                        ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: ‘template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)’
  213 |     next(_InputIterator __x, typename
      |     ^~~~
answer.code:12:17: note:                 ‘int next [400010]’
   12 | int first[maxn],next[maxm*2],tot;
      |                 ^~~~
answer.code:44:38: error: reference to ‘next’ is ambiguous
   44 |                 memset(next,0,sizeof next);
      |                                      ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/bits/specfun.h:45,
                 from /usr/include/c++/11/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: ‘template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)’
  213 |     next(_InputIterator __x, typename
      |     ^~~~
answer.code:12:17: note:                 ‘int next [400010]’
   12 | int first[maxn],next[maxm*2],tot;
      |                 ^~~~
answer.code:47:17: error: ‘gets’ was not declared in this scope; did you mean ‘getw’?
   47 |                 gets(c+1);
      |                 ^~~~
      |                 getw
answer.code:51:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   51 |                         scanf("%d%d",&a,&b);
      |                         ~~~~~^~~~~~~~~~~~~~