# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1073492 | 2024-08-24T15:21:51 Z | blushingecchigirl | Comparing Plants (IOI20_plants) | C++17 | 0 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back vector<pair<pair<int, int>, pair<int, int>>> p; void init(int k, std::vector<int> r) { int n = r.size(), x; p.resize(n); for(int i = 0; i<n; i++) { if(r[i]!=r[(i+1)%n]) { x = i; break; } } int cur = 0, g = 0; for(int i = x; i<n+x; i++) { p[i%n].second.first = cur; if(r[i%n]) cur--; else cur++; p[i%n].second.second = cur; p[i%n].first.first = p[(i+1)%n].first.second = g; if(r[i%n] != r[(i+1)%n]) g++; } return; } int compare_plants(int x, int y) { auto a = p[x].first, b = p[y].first; if(a.first == b.second) { if(p[x].second.first>p[y].second.second) return 1; return -1; } if(a.second == b.first) { if(p[x].second.second>p[y].second.first) return 1; return -1; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |