/ Vijos /

记录详情

Compile Error

foo.cc: In function 'bool cmp(node, node)':
foo.cc:9:14: error: expected ';' before '}' token
    9 |    return x.v
      |              ^
      |              ;
   10 | }
      | ~             
foo.cc: In function 'void dfs(int)':
foo.cc:15:11: error: reference to 'next' is ambiguous
   15 |         p=next[p];
      |           ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:3:20: note:                 'int next [22222]'
    3 | int n,m,vec[22222],next[22222],adj[2222],d[2222],ans[2222],sum,temp,x,y,dep[2222],tot=1,q[22222],l,r,p;
      |                    ^~~~
foo.cc: In function 'int main()':
foo.cc:23:19: error: reference to 'next' is ambiguous
   23 |       vec[tot]=x; next[tot]=adj[y]; adj[y]=tot++; d[x]++;
      |                   ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:3:20: note:                 'int next [22222]'
    3 | int n,m,vec[22222],next[22222],adj[2222],d[2222],ans[2222],sum,temp,x,y,dep[2222],tot=1,q[22222],l,r,p;
      |                    ^~~~
foo.cc:35:12: error: reference to 'next' is ambiguous
   35 |          p=next[p];
      |            ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from foo.cc:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:213:5: note: candidates are: 'template<class _InputIterator> _InputIterator std::next(_InputIterator, typename std::iterator_traits<_Iter>::difference_type)'
  213 |     next(_InputIterator __x, typename
      |     ^~~~
foo.cc:3:20: note:                 'int next [22222]'
    3 | int n,m,vec[22222],next[22222],adj[2222],d[2222],ans[2222],sum,temp,x,y,dep[2222],tot=1,q[22222],l,r,p;
      |                    ^~~~
foo.cc:19:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   19 |    scanf("%d%d",&n,&m);
      |    ~~~~~^~~~~~~~~~~~~~
foo.cc:20:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   20 |    for (int i=1; i<=n; i++) {scanf("%d",&lim[i].v); lim[i].id=i;}
      |                              ~~~~~^~~~~~~~~~~~~~~~
foo.cc:22:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   22 |       scanf("%d%d",&x,&y);
      |       ~~~~~^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1819 航空管制
语言
C++
递交时间
2022-02-15 21:43:14
评测时间
2022-02-15 21:43:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes