Submission #1165957

#TimeUsernameProblemLanguageResultExecution timeMemory
1165957inesPyramids (IOI24_pyramids)C++20
Compilation error
0 ms0 KiB
#include <vector>
#include<numeric>
using namespace std;

vector<int> pyramidsA, pyramidsB;

void init(vector<int> A, vector<int> B) {
    pyramidsA = A;
    pyramidsB = B;
}

bool can_transform(int L, int R, int X, int Y) {

    long long sumA=accumulate(pyramidsA.begin()+L,pyramids.begin()+R+1,0);
      long long sumB=accumulate(pyramidsA.begin()+X,pyramids.begin()+Y+1,0);


    if (sumA != sumB) {
        return false;
    }
    else{

    return true;
    }
}

Compilation message (stderr)

pyramids.cpp: In function 'bool can_transform(int, int, int, int)':
pyramids.cpp:14:51: error: 'pyramids' was not declared in this scope; did you mean 'pyramidsB'?
   14 |     long long sumA=accumulate(pyramidsA.begin()+L,pyramids.begin()+R+1,0);
      |                                                   ^~~~~~~~
      |                                                   pyramidsB