# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1165499 | aminabouakaz | Pyramids (IOI24_pyramids) | C++20 | 0 ms | 0 KiB |
#include <vector>
#include <numeric>
using namespace std;
class PyramidTransform {
public:
vector<int> A, B;
void init(vector<int> A, vector<int> B) {
this->A = A;
this->B = B;
}
bool can_transform(int L, int R, int X, int Y) {
int sum_A = accumulate(A.begin() + L, A.begin() + R + 1, 0);
int sum_B = accumulate(B.begin() + X, B.begin() + Y + 1, 0);
return sum_A == sum_B;
}
};