#include <bits/stdc++.h>
using namespace std;
vector<int> r;
int n;
void init(int k, std::vector<int> rr) {
r = rr;
n = r.size();
}
int compare_plants(int x, int y) {
int n1 = (x + 1) % n;
int n2 = (x + 2) % n;
if (r[x] == 0 && (y == n1 || y == n2)) return 1;
if (r[x] == 2 && (y == n1 || y == n2)) return -1;
int yn1 = (y + 1) % n;
int yn2 = (y + 2) % n;
if (r[y] == 0 && (x == yn1 || x == yn2)) return -1;
if (r[y] == 2 && (x == yn1 || x == yn2)) return 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... |