#include "candies.h"
#include "bits/stdc++.h"
#define pb push_back
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
vector<int> distribute_candies(vector<int> c,vector<int> l,
vector<int> r, vector<int> v) {
int n=sz(c),q=sz(l);
vector<int> cur(n,0);
for(int i=0;i<q;i++){
for(int xl=l[i];xl<=r[i];xl++){
cur[xl]+=v[i];
cur[xl]=max(cur[xl],0);
cur[xl]=min(cur[xl],c[xl]);
}
}
return cur;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5068 ms |
12264 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
179 ms |
8176 KB |
Output is correct |
3 |
Correct |
177 ms |
6028 KB |
Output is correct |
4 |
Execution timed out |
5061 ms |
13408 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
453 ms |
7904 KB |
Output is correct |
4 |
Correct |
439 ms |
4036 KB |
Output is correct |
5 |
Execution timed out |
5050 ms |
10992 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Execution timed out |
5068 ms |
12264 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |