#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll N, Q;
vector<int> a;
std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
std::vector<int> r, std::vector<int> v) {
N = c.size(), Q = l.size();
a.resize(N);
for(int i = 0; i < Q; i++){
for(int j = l[i]; j <= r[i]; j++){
a[j] += v[i];
a[j] = min(a[j], c[j]);
a[j] = max(a[j], 0);
}
}
return a;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 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 |
312 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
5086 ms |
7264 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
231 ms |
8044 KB |
Output is correct |
3 |
Correct |
231 ms |
6792 KB |
Output is correct |
4 |
Execution timed out |
5041 ms |
13264 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
588 ms |
7660 KB |
Output is correct |
4 |
Correct |
606 ms |
4796 KB |
Output is correct |
5 |
Execution timed out |
5087 ms |
10840 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 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 |
312 KB |
Output is correct |
6 |
Execution timed out |
5086 ms |
7264 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |