# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1073836 | 2024-08-24T23:07:39 Z | tolbi | Comparing Plants (IOI20_plants) | C++17 | 1 ms | 348 KB |
#include "plants.h" #include <set> std::vector<int> r; std::set<int> st; void init(int k, std::vector<int> r) { ::r=r; for (int i = 0; i < r.size(); i++){ if (r[i]!=r[(i+r.size()-1)%r.size()]){ st.insert(i); } } } int compare_plants(int x, int y) { if (st.size()==0) return r[0]?1:-1; auto lb = st.lower_bound(x+1); if (lb!=st.end() && *lb <= y) return 0; if (lb==st.begin()){ lb = std::prev(st.end()); } else lb--; return r[*lb]?1:-1; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 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 | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |