/ Vijos /

记录详情

Compile Error

foo.cc: In function 'void insect(int, int)':
foo.cc:11:26: error: reference to 'next' is ambiguous
   11 | void insect(int x,int y){next[cnt]=point[x];point[x]=cnt;v[cnt]=y;cnt++;}
      |                          ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/algorithm:61,
                 from foo.cc:3:
/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:5:19: note:                 'int next [200003]'
    5 | int point[100003],next[200003],v[200003],cnt=0,N,l[100003],r[100003],pre[100003],con[100003];
      |                   ^~~~
foo.cc: In function 'void dfs(int)':
foo.cc:16:29: error: reference to 'next' is ambiguous
   16 |     for (i=point[x];i!=-1;i=next[i])
      |                             ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/algorithm:61,
                 from foo.cc:3:
/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:5:19: note:                 'int next [200003]'
    5 | int point[100003],next[200003],v[200003],cnt=0,N,l[100003],r[100003],pre[100003],con[100003];
      |                   ^~~~
foo.cc: In function 'void work(int)':
foo.cc:30:15: warning: unused variable 's' [-Wunused-variable]
   30 |     long long s=0; int num=1000000008;
      |               ^
foo.cc:30:24: warning: unused variable 'num' [-Wunused-variable]
   30 |     long long s=0; int num=1000000008;
      |                        ^~~
foo.cc: In function 'int main()':
foo.cc:105:12: error: reference to 'next' is ambiguous
  105 |     memset(next,-1,sizeof(next));
      |            ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/algorithm:61,
                 from foo.cc:3:
/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:5:19: note:                 'int next [200003]'
    5 | int point[100003],next[200003],v[200003],cnt=0,N,l[100003],r[100003],pre[100003],con[100003];
      |                   ^~~~
foo.cc:105:27: error: reference to 'next' is ambiguous
  105 |     memset(next,-1,sizeof(next));
      |                           ^~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/algorithm:61,
                 from foo.cc:3:
/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:5:19: note:                 'int next [200003]'
    5 | int point[100003],next[200003],v[200003],cnt=0,N,l[100003],r[100003],pre[100003],con[100003];
      |                   ^~~~
foo.cc:122:22: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
  122 |      printf("%d\n%I64d\n",dp[l[1]][0][1],f[l[1]][0][1]);
      |                  ~~~~^                   ~~~~~~~~~~~~~
      |                      |                               |
      |                      int                             long long int
      |                  %I64lld
foo.cc:125:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
  125 |       printf("%d\n%I64d\n",1+dp[l[1]][1][0],f[l[1]][1][0]);
      |                   ~~~~^                     ~~~~~~~~~~~~~
      |                       |                                 |
      |                       int                               long long int
      |                   %I64lld
foo.cc:127:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
  127 |       printf("%d\n%I64d\n",1+dp[l[1]][1][0],(f[l[1]][0][1]+f[l[1]][1][0])%mo);
      |                   ~~~~^                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                       |                                                  |
      |                       int                                                long long int
      |                   %I64lld
foo.cc:112:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  112 |     scanf("%d\n",&N);
      |     ~~~~~^~~~~~~~~~~
foo.cc:117:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  117 |         scanf("%d %d\n",&x,&y);
      |         ~~~~~^~~~~~~~~~~~~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1770 大内密探
语言
C++
递交时间
2022-01-12 16:58:17
评测时间
2022-01-12 16:58:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes