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 "pyramids.h"
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define cmin(a, b) a = min(a, b)
#define cmax(a, b) a = max(a, b)
vector<long long> pref1, pref2;
void init(vector<int> a, vector<int> b) {
pref1.pb(a[0]), pref2.pb(b[0]);
for (int i=1; i<sz(a); i++) {
pref1.pb(pref1.back()+a[i]);
pref2.pb(pref2.back()+b[i]);
}
}
bool can_transform(int l, int r, int x, int y) {
long long sum1=pref1[r]-(l?pref1[l-1]:0), sum2=pref2[y]-(x?pref2[x-1]:0);
return sum1==sum2;
}
# | 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... |