#include <bits/stdc++.h>
using namespace std;
vector<int> distribute_candies(vector<int> C, vector<int> L, vector<int> R, vector<int> V) {
int n = C.size();
vector<int> A(n);
int q = L.size();
for(int i = 0; i < q; ++i) {
for(int j = L[i]; j <= R[i]; ++j) {
A[j] += V[i];
A[j] = max(A[j], 0); A[j] = min(A[j], C[j]);
}
}
return A;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
312 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
3 ms |
404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5032 ms |
12116 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
213 ms |
8036 KB |
Output is correct |
3 |
Correct |
219 ms |
6048 KB |
Output is correct |
4 |
Execution timed out |
5019 ms |
13216 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
514 ms |
7768 KB |
Output is correct |
4 |
Correct |
510 ms |
4004 KB |
Output is correct |
5 |
Execution timed out |
5043 ms |
10832 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
312 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
3 ms |
404 KB |
Output is correct |
6 |
Execution timed out |
5032 ms |
12116 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |