#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
#include "candies.h"
vi distribute_candies(vi C, vi L, vi R, vi V) {
int N = C.size();
int Q = V.size();
vi ans(N, 0);
for (int i = 0; i < Q; i++) {
for (int j = L[i]; j <= R[i]; j++) {
ans[j] += V[i];
ans[j] = max(ans[j], 0);
ans[j] = min(ans[j], C[j]);
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2388 ms |
7252 KB |
Output is correct |
2 |
Correct |
2480 ms |
7252 KB |
Output is correct |
3 |
Correct |
2459 ms |
9552 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
58 ms |
5156 KB |
Output is correct |
3 |
Correct |
54 ms |
3908 KB |
Output is correct |
4 |
Correct |
2465 ms |
7252 KB |
Output is correct |
5 |
Correct |
2470 ms |
10820 KB |
Output is correct |
6 |
Correct |
2580 ms |
10832 KB |
Output is correct |
7 |
Correct |
2483 ms |
7492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
600 KB |
Output is correct |
3 |
Correct |
102 ms |
5112 KB |
Output is correct |
4 |
Correct |
93 ms |
2880 KB |
Output is correct |
5 |
Execution timed out |
5061 ms |
7260 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 |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
2388 ms |
7252 KB |
Output is correct |
7 |
Correct |
2480 ms |
7252 KB |
Output is correct |
8 |
Correct |
2459 ms |
9552 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
58 ms |
5156 KB |
Output is correct |
11 |
Correct |
54 ms |
3908 KB |
Output is correct |
12 |
Correct |
2465 ms |
7252 KB |
Output is correct |
13 |
Correct |
2470 ms |
10820 KB |
Output is correct |
14 |
Correct |
2580 ms |
10832 KB |
Output is correct |
15 |
Correct |
2483 ms |
7492 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
600 KB |
Output is correct |
18 |
Correct |
102 ms |
5112 KB |
Output is correct |
19 |
Correct |
93 ms |
2880 KB |
Output is correct |
20 |
Execution timed out |
5061 ms |
7260 KB |
Time limit exceeded |
21 |
Halted |
0 ms |
0 KB |
- |