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 "candies.h"
using namespace std;
const int maxn = 2e5 + 12;
int a[maxn];
int n, m;
vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v){
n = c.size(), m = l.size();
for(int i=0;i<m;i++){
for(int j=l[i];j<=r[i];j++){
a[j] += v[i];
if(a[j] < 0) a[j] = 0;
if(a[j] > c[j]) a[j] = c[j];
}
}
return vector<int> (a, a+n);
}
# | 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... |