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 "candies.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) x.begin, x.end()
#define en cout << '\n';
#define ll long long int
const int N = 2e5+10;
vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) {
int n = c.size(), q = l.size();
vector<int> s(n);
for(int j = 0; j < q; ++j){
for(int L = l[j]; L <= r[j]; ++L){
s[L] = min(c[L], max(s[L] + v[j], 0));
}
}
return s;
}
# | 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... |