This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
vector<int>l(200005),h(200005);
int N;
void init(int k, vector<int>r) {
N = r.size();
for(int i = 1 ; i < N ; i++) {
if(r[i-1]) {
h[i] = h[i-1];
l[i] = i;
} else {
h[i] = i;
l[i] = l[i-1];
}
}
}
int compare_plants(int x, int y) {
if(h[y] == h[x])
return 0;
if(l[y] == l[x])
return 1;
if(h[N-1] == h[y] && h[x] == h[0])
return 1;
if(l[N-1] == l[y] && l[x] == l[0])
return 0;
return -1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |