#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 |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
3 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5033 ms |
19156 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
185 ms |
12744 KB |
Output is correct |
3 |
Correct |
187 ms |
10080 KB |
Output is correct |
4 |
Execution timed out |
5032 ms |
20292 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
474 ms |
12384 KB |
Output is correct |
4 |
Correct |
465 ms |
8104 KB |
Output is correct |
5 |
Execution timed out |
5054 ms |
17880 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
3 ms |
460 KB |
Output is correct |
6 |
Execution timed out |
5033 ms |
19156 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |