#include <bits/stdc++.h>
#include "candies.h"
using namespace std;
typedef long long ll;
vector<int> distribute_candies(vector<int> c, vector<int> l,
vector<int> r, vector<int> v) {
ll n = c.size(), q = v.size();
vector<int> res(n);
for (int i = 0; i < q; i++) {
for (int j = l[i]; j <= r[i]; j++) {
res[j] = clamp(res[j] + v[i], 0, c[j]);
}
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
5090 ms |
7420 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
121 ms |
8160 KB |
Output is correct |
3 |
Correct |
160 ms |
5956 KB |
Output is correct |
4 |
Execution timed out |
5048 ms |
13172 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
432 KB |
Output is correct |
3 |
Correct |
378 ms |
7784 KB |
Output is correct |
4 |
Correct |
811 ms |
4036 KB |
Output is correct |
5 |
Execution timed out |
5052 ms |
10988 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Execution timed out |
5090 ms |
7420 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |