QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#68054#4152. 工作安排 ZhangYiDeCompile Error//C++201.8kb2022-12-14 12:31:572022-12-14 12:31:59

Details

answer.code: In function ‘void add(int, int, int, int)’:
answer.code:12:52: error: reference to ‘next’ is ambiguous
   12 |     to[++cnt] = y , val[cnt] = v , cost[cnt] = c , next[cnt] = head[x] , head[x] = cnt;
      |                                                    ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/deque:60,
                 from /usr/include/c++/11/queue:60,
                 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:9:53: note:                 ‘int next [1000010]’
    9 | int temp[10] , head[N] , to[M] , val[M] , cost[M] , next[M] , cnt = 1 , s , t , dis[N] , from[N] , pre[N];
      |                                                     ^~~~
answer.code:13:53: error: reference to ‘next’ is ambiguous
   13 |     to[++cnt] = x , val[cnt] = 0 , cost[cnt] = -c , next[cnt] = head[y] , head[y] = cnt;
      |                                                     ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/deque:60,
                 from /usr/include/c++/11/queue:60,
                 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:9:53: note:                 ‘int next [1000010]’
    9 | int temp[10] , head[N] , to[M] , val[M] , cost[M] , next[M] , cnt = 1 , s , t , dis[N] , from[N] , pre[N];
      |                                                     ^~~~
answer.code: In function ‘bool spfa()’:
answer.code:24:35: error: reference to ‘next’ is ambiguous
   24 |         for(i = head[x] ; i ; i = next[i])
      |                                   ^~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:66,
                 from /usr/include/c++/11/deque:60,
                 from /usr/include/c++/11/queue:60,
                 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:9:53: note:                 ‘int next [1000010]’
    9 | int temp[10] , head[N] , to[M] , val[M] , cost[M] , next[M] , cnt = 1 , s , t , dis[N] , from[N] , pre[N];
      |                                                     ^~~~
answer.code: In function ‘int main()’:
answer.code:46:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   46 |     scanf("%d%d" , &m , &n) , s = 0 , t = n + m + 1;
      |     ~~~~~^~~~~~~~~~~~~~~~~~
answer.code:47:38: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   47 |     for(i = 1 ; i <= n ; i ++ ) scanf("%d" , &x) , add(s , i , x , 0);
      |                                 ~~~~~^~~~~~~~~~~
answer.code:52:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   52 |             scanf("%d" , &x);
      |             ~~~~~^~~~~~~~~~~
answer.code:58:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   58 |         scanf("%d" , &k);
      |         ~~~~~^~~~~~~~~~~
answer.code:59:42: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   59 |         for(j = 1 ; j <= k ; j ++ ) scanf("%d" , &temp[j]);
      |                                     ~~~~~^~~~~~~~~~~~~~~~~
answer.code:61:46: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   61 |         for(j = 1 ; j <= k + 1 ; j ++ ) scanf("%d" , &x) , add(i + n , t , temp[j] - temp[j - 1] , x);
      |                                         ~~~~~^~~~~~~~~~~