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>
#define ST first
#define ND second
#define PB push_back
using namespace std;
using ll = long long;
using pi = pair<int,int>;
using vi = vector<int>;
int n, q;
vi distribute_candies(vi c, vi l, vi r, vi v) {
n = (int)c.size();
q = (int)l.size();
vi ans(n);
for(int i = 0; i < q; ++i) {
for(int a = l[i]; a <= r[i]; a++) {
ans[a] += v[i];
ans[a] = max(ans[a], 0);
ans[a] = min(ans[a], c[i]);
}
}
return ans;
}
# | 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... |