#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 |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
Correct |
2573 ms |
7252 KB |
Output is correct |
2 |
Correct |
2644 ms |
11568 KB |
Output is correct |
3 |
Correct |
2615 ms |
11348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
54 ms |
5100 KB |
Output is correct |
3 |
Correct |
52 ms |
3756 KB |
Output is correct |
4 |
Correct |
2517 ms |
7492 KB |
Output is correct |
5 |
Correct |
2472 ms |
13808 KB |
Output is correct |
6 |
Correct |
2498 ms |
14200 KB |
Output is correct |
7 |
Correct |
2536 ms |
13360 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
90 ms |
5160 KB |
Output is correct |
4 |
Correct |
131 ms |
2884 KB |
Output is correct |
5 |
Execution timed out |
5013 ms |
7248 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
Correct |
2573 ms |
7252 KB |
Output is correct |
7 |
Correct |
2644 ms |
11568 KB |
Output is correct |
8 |
Correct |
2615 ms |
11348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
54 ms |
5100 KB |
Output is correct |
11 |
Correct |
52 ms |
3756 KB |
Output is correct |
12 |
Correct |
2517 ms |
7492 KB |
Output is correct |
13 |
Correct |
2472 ms |
13808 KB |
Output is correct |
14 |
Correct |
2498 ms |
14200 KB |
Output is correct |
15 |
Correct |
2536 ms |
13360 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
90 ms |
5160 KB |
Output is correct |
19 |
Correct |
131 ms |
2884 KB |
Output is correct |
20 |
Execution timed out |
5013 ms |
7248 KB |
Time limit exceeded |
21 |
Halted |
0 ms |
0 KB |
- |