#include<bits/stdc++.h>
using namespace std;
vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v)
{
int n=c.size();
int q=l.size();
vector<int>ans(n,0);
for(int i=0;i<q;i++)
{
for(int j=l[i];j<=r[i];j++)
{
if(v[i]>0)ans[j]=min(c[j],ans[j]+v[i]);
else ans[j]=max(0,ans[j]+v[i]);
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
288 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
2 ms |
300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
5069 ms |
7236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
182 ms |
8012 KB |
Output is correct |
3 |
Correct |
164 ms |
6008 KB |
Output is correct |
4 |
Execution timed out |
5033 ms |
13256 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
392 ms |
7644 KB |
Output is correct |
4 |
Correct |
381 ms |
3892 KB |
Output is correct |
5 |
Execution timed out |
5065 ms |
10820 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
288 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
2 ms |
300 KB |
Output is correct |
6 |
Execution timed out |
5069 ms |
7236 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |