Submission #830432

#TimeUsernameProblemLanguageResultExecution timeMemory
830432tolbiRarest Insects (IOI22_insects)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> using namespace std; #include "insects.h" int min_cardinality(int N) { int l = 1, r = N; auto check = [&](int x)->bool{ vector<int> crr; for (int i = 0; i < x; i++){ crr.push_back(i); move_inside(i); } bool boolean=false; for (int i = x; i < N; i++){ move_inside(i); crr.push_back(i); if (press_button()>x){ move_outside(i); crr.pop_back(); } else boolean=true; } while (crr.size()){ move_outside(crr.back()); crr.pop_back(); } return boolean; }; while (l<r){ int mid = l+(r-l)/2; if (check(mid)){ r=mid; } else { l=mid+1; } } return l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...