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;
typedef vector<int> vi;
vi distribute_candies(vi c, vi l, vi r, vi v){
int i, j;
int q = l.size();
int n = c.size();
vi val(n, 0);
for(i=0;i<n;i++){
for(j=0;j<q;j++){
if(i>=l[j] && i<=r[j]){
if(v[j]<0) val[i] = max(0, val[i]+v[j]);
else val[i] = min(c[i], val[i]+v[j]);
}
}
}
return val;
}
# | 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... |