#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, q;
vector < int > s;
vector<int> distribute_candies(vector<int> c, vector<int> l,
vector<int> r, vector<int> v) {
n = c.size();
q = l.size();
s.resize(n, 0);
for (int i = 0; i < q; i ++)
{
for (int j = l[i]; j <= r[i]; j ++)
{
s[j] += v[i];
if (s[j] < 0)
s[j] = 0;
if (s[j] > c[j])
s[j] = c[j];
}
}
return s;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
300 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
6 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
5044 ms |
12080 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
529 ms |
8028 KB |
Output is correct |
3 |
Correct |
455 ms |
6784 KB |
Output is correct |
4 |
Execution timed out |
5070 ms |
13284 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Correct |
1 ms |
296 KB |
Output is correct |
3 |
Correct |
1421 ms |
7656 KB |
Output is correct |
4 |
Correct |
1357 ms |
4776 KB |
Output is correct |
5 |
Execution timed out |
5020 ms |
10844 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
300 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
6 ms |
340 KB |
Output is correct |
6 |
Execution timed out |
5044 ms |
12080 KB |
Time limit exceeded |
7 |
Halted |
0 ms |
0 KB |
- |