#include "pyramids.h"
#include <cassert>
std::vector<long long> preA, preB;
void init(std::vector<int> A, std::vector<int> B) {
preA.resize(A.size() + 1, 0);
preB.resize(B.size() + 1, 0);
assert(A.size() == B.size());
int n = A.size();
for (int i = 0; i < n; ++i) {
preA[i + 1] = preA[i] + A[i];
preB[i + 1] = preB[i] + B[i];
}
}
bool can_transform(int L, int R, int X, int Y) {
return (preA[R + 1] - preA[L]) == (preB[Y + 1] - preB[X]);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |