# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
303258 | 2020-09-20T06:35:53 Z | Kevin_Zhang_TW | Comparing Plants (IOI20_plants) | C++17 | 1 ms | 384 KB |
#include "plants.h" #include<bits/stdc++.h> #define pb emplace_back using namespace std; using ll = long long; #ifdef KEV #define DE(a, b) cerr << #a << ' ' << a << b void debug(auto L, auto R) { while (L != R) cerr << *L << " \n"[L+1==R], ++L; } #else #define DE(...) 0 void debug(...) {} #endif const int maxn = 300010; #define PI pair<int,int> int nxt[maxn], n, r[maxn], k; set<pair<int,int>> win; int F(int i) { return i % n; } void init(int k, std::vector<int> r) { ::k = k; n = r.size(); for (int i = 0;i < n;++i) win.insert( r[i]? PI{F(i+1), i} : PI{i, F(i+1)}); return; } int compare_plants(int x, int y) { if (win.count({x, y})) return 1; if (win.count({y, x})) return -1; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 0 ms | 384 KB | Output is correct |
5 | Incorrect | 0 ms | 384 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Incorrect | 0 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Incorrect | 0 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 384 KB | Output is correct |
3 | Incorrect | 0 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Incorrect | 1 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 0 ms | 384 KB | Output is correct |
5 | Incorrect | 0 ms | 384 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |