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;
const int MAXN = 2e5+5;
bool lt[MAXN];
int n;
void init(int k, vector<int> r) {
n = r.size();
for (int i = 0; i < n; i++) {
lt[i] = !r[i];
}
return;
}
int compare_plants(int x, int y) {
if (x != (y+1)%n && y != (x+1)%n) return 0;
if (x == (y+1)%n) return 2*(!lt[y])-1;
return 2*lt[x]-1;
return 0;
}
# | 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... |