#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 |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
4 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
3 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6097 ms |
7220 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
240 ms |
4964 KB |
Output is correct |
3 |
Correct |
236 ms |
3744 KB |
Output is correct |
4 |
Execution timed out |
6093 ms |
7228 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
599 ms |
4944 KB |
Output is correct |
4 |
Correct |
596 ms |
2796 KB |
Output is correct |
5 |
Execution timed out |
6036 ms |
7256 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
4 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
3 ms |
332 KB |
Output is correct |
6 |
Execution timed out |
6097 ms |
7220 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |