#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
const int M = 200005;
int pref[M];
int n;
void init(int k, vector<int> r) {
n = r.size();
for(int i=0;i<n;i++){
pref[i+1] = pref[i]+r[i];
}
return;
}
int compare_plants(int x, int y) {
if(pref[y]-pref[x] == 0)return 1;
if(pref[n]-pref[y]+pref[x] == 0)return -1;
if(pref[y]-pref[x] == y-x)return -1;
if(pref[n]-pref[y]+pref[x] == n-y+x)return 1;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
224 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
59 ms |
4036 KB |
Output is correct |
7 |
Correct |
102 ms |
5400 KB |
Output is correct |
8 |
Correct |
129 ms |
7872 KB |
Output is correct |
9 |
Correct |
90 ms |
7876 KB |
Output is correct |
10 |
Correct |
92 ms |
7876 KB |
Output is correct |
11 |
Correct |
96 ms |
7876 KB |
Output is correct |
12 |
Correct |
97 ms |
7900 KB |
Output is correct |
13 |
Correct |
100 ms |
7896 KB |
Output is correct |
14 |
Correct |
99 ms |
7896 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
224 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
59 ms |
4036 KB |
Output is correct |
7 |
Correct |
102 ms |
5400 KB |
Output is correct |
8 |
Correct |
129 ms |
7872 KB |
Output is correct |
9 |
Correct |
90 ms |
7876 KB |
Output is correct |
10 |
Correct |
92 ms |
7876 KB |
Output is correct |
11 |
Correct |
96 ms |
7876 KB |
Output is correct |
12 |
Correct |
97 ms |
7900 KB |
Output is correct |
13 |
Correct |
100 ms |
7896 KB |
Output is correct |
14 |
Correct |
99 ms |
7896 KB |
Output is correct |
15 |
Correct |
1 ms |
204 KB |
Output is correct |
16 |
Correct |
1 ms |
204 KB |
Output is correct |
17 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
18 |
Halted |
0 ms |
0 KB |
- |