Submission #412644

#TimeUsernameProblemLanguageResultExecution timeMemory
412644SuhaibSawalha1Comparing Plants (IOI20_plants)C++17
5 / 100
217 ms8380 KiB
#include "plants.h" #include <bits/stdc++.h> using namespace std; vector<int> o, z; #define lb(x, v) lower_bound(x.begin(), x.end(), v) bool ok (int x, int y, vector<int> &b) { if (x > y) { return lb(b, x) == b.end() && lb(b, y) == b.begin(); } return lb(b, x) == lb(b, y); } void init(int k, vector<int> r) { int n = r.size(); for (int i = 0; i < n; ++i) { (r[i] ? o : z).push_back(i); } } int compare_plants(int x, int y) { return ok(x, y, o) || ok(y, x, z) ? 1 : ok(x, y, z) || ok(y, x, o) ? -1 : 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...