#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 |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2664 ms |
12332 KB |
Output is correct |
2 |
Correct |
2554 ms |
11344 KB |
Output is correct |
3 |
Correct |
2574 ms |
11396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
79 ms |
8024 KB |
Output is correct |
3 |
Correct |
60 ms |
5920 KB |
Output is correct |
4 |
Correct |
2804 ms |
13404 KB |
Output is correct |
5 |
Correct |
2471 ms |
13796 KB |
Output is correct |
6 |
Correct |
2581 ms |
14180 KB |
Output is correct |
7 |
Correct |
2862 ms |
13412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
444 KB |
Output is correct |
3 |
Correct |
105 ms |
7756 KB |
Output is correct |
4 |
Correct |
143 ms |
3928 KB |
Output is correct |
5 |
Execution timed out |
5044 ms |
10972 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 |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
2664 ms |
12332 KB |
Output is correct |
7 |
Correct |
2554 ms |
11344 KB |
Output is correct |
8 |
Correct |
2574 ms |
11396 KB |
Output is correct |
9 |
Correct |
1 ms |
344 KB |
Output is correct |
10 |
Correct |
79 ms |
8024 KB |
Output is correct |
11 |
Correct |
60 ms |
5920 KB |
Output is correct |
12 |
Correct |
2804 ms |
13404 KB |
Output is correct |
13 |
Correct |
2471 ms |
13796 KB |
Output is correct |
14 |
Correct |
2581 ms |
14180 KB |
Output is correct |
15 |
Correct |
2862 ms |
13412 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
444 KB |
Output is correct |
18 |
Correct |
105 ms |
7756 KB |
Output is correct |
19 |
Correct |
143 ms |
3928 KB |
Output is correct |
20 |
Execution timed out |
5044 ms |
10972 KB |
Time limit exceeded |
21 |
Halted |
0 ms |
0 KB |
- |