Submission #1165505

#TimeUsernameProblemLanguageResultExecution timeMemory
1165505inesPyramids (IOI24_pyramids)C++20
Compilation error
0 ms0 KiB
#include "pyramids.h" #include<numeric> #include<vector> vector<int>A,B; void init(std::vector<int> a, std::vector<int> b) { a=A; b=B; // Initialization code } bool can_transform(int L, int R, int X, int Y) { 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 true; } else{ return false; } }

Compilation message (stderr)

pyramids.cpp:4:2: error: 'vector' does not name a type
    4 |  vector<int>A,B;
      |  ^~~~~~
pyramids.cpp: In function 'void init(std::vector<int>, std::vector<int>)':
pyramids.cpp:7:5: error: 'A' was not declared in this scope
    7 |   a=A;
      |     ^
pyramids.cpp:8:5: error: 'B' was not declared in this scope
    8 |   b=B;
      |     ^
pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:13:29: error: 'A' was not declared in this scope
   13 |     int sum=std::accumulate(A.begin()+L,A.begin()+R,0);
      |                             ^
pyramids.cpp:14:30: error: 'B' was not declared in this scope
   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);
      |                                                    ^