#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
int N,A[200005];
void init(int k, vector<int> r) {
N = r.size(), A[0] = 0;
for (int i = 0; i < N; ++i) A[i+1] = A[i]+r[i];
}
int compare_plants(int x, int y) {
if (A[y]-A[x] == y-x) return -1;
if (A[y]-A[x] == 0) return 1;
if (A[N]-(A[y]-A[x]) == N-(y-x)) return 1;
if (A[N]-(A[y]-A[x]) == 0) return -1;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
45 ms |
4056 KB |
Output is correct |
7 |
Correct |
53 ms |
5452 KB |
Output is correct |
8 |
Correct |
75 ms |
7912 KB |
Output is correct |
9 |
Correct |
81 ms |
7884 KB |
Output is correct |
10 |
Correct |
73 ms |
7888 KB |
Output is correct |
11 |
Correct |
70 ms |
7832 KB |
Output is correct |
12 |
Correct |
67 ms |
7920 KB |
Output is correct |
13 |
Correct |
77 ms |
7904 KB |
Output is correct |
14 |
Correct |
74 ms |
7896 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
312 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
45 ms |
4056 KB |
Output is correct |
7 |
Correct |
53 ms |
5452 KB |
Output is correct |
8 |
Correct |
75 ms |
7912 KB |
Output is correct |
9 |
Correct |
81 ms |
7884 KB |
Output is correct |
10 |
Correct |
73 ms |
7888 KB |
Output is correct |
11 |
Correct |
70 ms |
7832 KB |
Output is correct |
12 |
Correct |
67 ms |
7920 KB |
Output is correct |
13 |
Correct |
77 ms |
7904 KB |
Output is correct |
14 |
Correct |
74 ms |
7896 KB |
Output is correct |
15 |
Correct |
1 ms |
308 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Incorrect |
1 ms |
312 KB |
Output isn't correct |
18 |
Halted |
0 ms |
0 KB |
- |