This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "pyramids.h"
using namespace std;
typedef long long ll;
vector<ll> prefixA, prefixB;
void init(vector<int> A, vector<int> B) {
ll N = A.size();
prefixA.resize(N + 1, 0);
prefixB.resize(N + 1, 0);
for (ll i = 0; i < N; ++i) {
prefixA[i + 1] = prefixA[i] + A[i];
prefixB[i + 1] = prefixB[i] + B[i];
}
}
bool can_transform(int L, int R, int X, int Y) {
ll sumA=(prefixA[R+1]-prefixA[L]);
ll sumB=(prefixB[Y+1]-prefixB[X]);
if(sumA==sumB){
return true;
}
else{
return false;
}
}
# | 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... |