Submission #1165876

#TimeUsernameProblemLanguageResultExecution timeMemory
1165876inesPyramids (IOI24_pyramids)C++20
Compilation error
0 ms0 KiB
#include "pyramids.h" void init(std::vector<int> A, std::vector<int> B) { static std::vectstaticor<int> staticA= A; static std::vector<int> staticB= B; } // Initialization code } bool can_transform(int L, int R, int X, int Y) { static std::vectstaticor<int> staticA; static std::vector<int> staticB= B; int sum=std::accumulate(A.begin()+L,A.begin()+R,0); int sum2=std::accumulate(B.begin()+X,B.begin()+y,0); if(sum!=sum2){ return false; } else if(sum1==sum2){ int d=0; for(int i=0;i<n; i++){ for(int j=i;j<n; j++){ if(A[i]!=B[i]){ d=d+1; } } } } if(d>1){ return false; } else{ return true; } }

Compilation message (stderr)

pyramids.cpp: In function 'void init(std::vector<int>, std::vector<int>)':
pyramids.cpp:4:16: error: 'vectstaticor' in namespace 'std' does not name a template type
    4 |    static std::vectstaticor<int> staticA= A;
      |                ^~~~~~~~~~~~
pyramids.cpp: At global scope:
pyramids.cpp:8:1: error: expected declaration before '}' token
    8 | }
      | ^
pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:11:18: error: 'vectstaticor' in namespace 'std' does not name a template type
   11 |      static std::vectstaticor<int> staticA;
      |                  ^~~~~~~~~~~~
pyramids.cpp:12:39: error: 'B' was not declared in this scope
   12 |      static std::vector<int> staticB= B;
      |                                       ^
pyramids.cpp:13:19: error: 'accumulate' is not a member of 'std'
   13 |      int sum=std::accumulate(A.begin()+L,A.begin()+R,0);
      |                   ^~~~~~~~~~
pyramids.cpp:13:30: error: 'A' was not declared in this scope
   13 |      int sum=std::accumulate(A.begin()+L,A.begin()+R,0);
      |                              ^
pyramids.cpp:14:19: error: 'accumulate' is not a member of 'std'
   14 |     int sum2=std::accumulate(B.begin()+X,B.begin()+y,0);
      |                   ^~~~~~~~~~
pyramids.cpp:14:52: error: 'y' was not declared in this scope
   14 |     int sum2=std::accumulate(B.begin()+X,B.begin()+y,0);
      |                                                    ^
pyramids.cpp:18:13: error: 'sum1' was not declared in this scope; did you mean 'sum2'?
   18 |     else if(sum1==sum2){
      |             ^~~~
      |             sum2
pyramids.cpp:20:21: error: 'n' was not declared in this scope
   20 |       for(int i=0;i<n; i++){
      |                     ^
pyramids.cpp:28:10: error: 'd' was not declared in this scope
   28 |       if(d>1){
      |          ^
pyramids.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^