| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 823181 | Sohsoh84 | Comparing Plants (IOI20_plants) | C++17 | 1 ms | 232 KiB |
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;
#define debug(x) cerr << #x << ": " << x << endl;
#define sep ' '
void add(int u, int v);
const int MAXN = 2e5 + 10;
int R[MAXN], n, k;
void init(int k_, std::vector<int> r) {
k = k_;
n = r.size();
for (int i = 0; i < n; i++)
R[i] = r[i];
}
int compare_plants(int x, int y) {
int flag = false;
if (x == (y + 1) % n) {
swap(x, y);
flag = true;
}
int ans = 0;
if (y == (x + 1) % n) {
if (R[x]) ans = -1;
else ans = 1;
}
return (flag ? -1 : 1) * ans;
}
| # | 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... | ||||
