QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#44953#4561. Catfish FarmHuangHanShengCompile Error//C++171.3kb2022-08-22 11:57:382022-08-22 11:57:38

Details

answer.code: In function ‘long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)’:
answer.code:13:25: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   13 |                 max_x = max(max_x, X[i]);
      |                         ^~~
      |                         std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:3:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:19:17: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
   19 |                 cout<<0<<"\n";
      |                 ^~~~
      |                 std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:75,
                 from answer.code:3:
/usr/include/c++/11/iostream:61:18: note: ‘std::cout’ declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
answer.code:21:17: error: ‘ll’ was not declared in this scope
   21 |                 ll cost[M], cost2[M];
      |                 ^~
answer.code:22:39: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   22 |                 for(int i=0;i<=M;i++) cost[i]=cost2[i]=0;
      |                                       ^~~~
      |                                       cosl
answer.code:22:47: error: ‘cost2’ was not declared in this scope
   22 |                 for(int i=0;i<=M;i++) cost[i]=cost2[i]=0;
      |                                               ^~~~~
answer.code:24:37: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   24 |                         if(X[i]==0) cost[Y[i]]+=W[i];
      |                                     ^~~~
      |                                     cosl
answer.code:25:30: error: ‘cost2’ was not declared in this scope
   25 |                         else cost2[Y[i]]+=W[i];
      |                              ^~~~~
answer.code:31:33: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   31 |                         curr += cost[i];
      |                                 ^~~~
      |                                 cosl
answer.code:32:34: error: ‘cost2’ was not declared in this scope
   32 |                         curr2 += cost2[i];
      |                                  ^~~~~
answer.code:33:32: error: ‘max’ was not declared in this scope; did you mean ‘std::max’?
   33 |                         maxi = max(maxi, curr);
      |                                ^~~
      |                                std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:3:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
answer.code:38:17: error: ‘ll’ was not declared in this scope
   38 |                 ll cost[M], cost2[M];
      |                 ^~
answer.code:39:39: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   39 |                 for(int i=0;i<=M;i++) cost[i]=cost2[i]=0;
      |                                       ^~~~
      |                                       cosl
answer.code:39:47: error: ‘cost2’ was not declared in this scope
   39 |                 for(int i=0;i<=M;i++) cost[i]=cost2[i]=0;
      |                                               ^~~~~
answer.code:41:37: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   41 |                         if(X[i]==0) cost[Y[i]]+=W[i];
      |                                     ^~~~
      |                                     cosl
answer.code:42:30: error: ‘cost2’ was not declared in this scope
   42 |                         else cost2[Y[i]]+=W[i];
      |                              ^~~~~
answer.code:48:43: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   48 |                         if(i==0) pre[i] = cost[i];
      |                                           ^~~~
      |                                           cosl
answer.code:49:46: error: ‘cost’ was not declared in this scope; did you mean ‘cosl’?
   49 |                         else pre[i]=pre[i-1]+cost[i];
      |                                              ^~~~
      |                                              cosl
answer.code:52:43: error: ‘cost2’ was not declared in this scope
   52 |                         if(i==N-1) suf[i]=cost2[i];
      |                                           ^~~~~
answer.code:53:46: error: ‘cost2’ was not declared in this scope
   53 |                         else suf[i]=suf[i+1]+cost2[i];
      |                                              ^~~~~
answer.code:56:24: error: ‘max’ was not declared in this s...