#include<bits/stdc++.h>
#include "candies.h"
#define ve vector<int>
using namespace std;
ve ans ,k;
ve distribute_candies(ve c, ve l, ve r, ve v){
int n =c.size() , q = v.size();
ans.resize(n , 0);
k.resize(n+1 , 0);
for(int i = 0; i < q; ++i){
k[l[i]] += v[i];
k[r[i] + 1] -= v[i];
}
for(int i = 1; i < n; ++i) k[i] += k[i - 1];
for(int i = 0;i < n; ++i) ans[i] = min(k[i] , c[i]);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
99 ms |
8892 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |