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>
using namespace std;
typedef long long ll;
vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) {
int n = c.size();
int q = l.size();
vector<int> a(n);
vector<ll> p(n + 1);
for (int j = 0; j < q; j++) {
p[l[j]] += v[j];
p[r[j]] -= v[j];
}
for (int i = 1; i <= n; i++) {
p[i] += p[i - 1];
}
for (int i = 0; i < n; i++) {
a[i] = min((ll)c[i], p[i]);
}
return a;
}
# | 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... |