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;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,tes,t,C[200009],L[200009],R[200009],V[200009],f[200009];
vector <int> ans;
vector<int> distribute_candies(vector<int> Cc, vector<int> Ll, vector<int> Rr, vector<int> Vv) {
a=Cc.size();tes=Ll.size();
for(i=1; i<=a; i++){
C[i]=Cc[i-1];
}
for(t=1; t<=tes; t++){
L[t]=Ll[t-1]+1;R[t]=Rr[t-1]+1;V[t]=Vv[t-1];
}
for(t=1; t<=tes; t++){
for(i=L[t]; i<=R[t]; i++){
f[i]+=V[t];
f[i]=max(0LL,f[i]);f[i]=min(C[i],f[i]);
}
}
for(i=1; i<=a; i++) ans.push_back(f[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... |