#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int> distribute_candies(vector<int> C, vector<int> L, vector<int> R, vector<int> V) {
int Q = (int)L.size(), N = (int)C.size();
vector<int> ans(N);
for(int i = 0; i < Q; ++i) {
ans[L[i]] += V[i];
if(R[i] + 1 < N) ans[R[i] + 1] -= V[i];
}
for(int i = 1; i < N; ++i) {
ans[i] += ans[i - 1];
}
for(int i = 0; i < N; ++i) {
ans[i] = min(ans[i], C[i]);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
80 ms |
7268 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |