Submission #1223508

#TimeUsernameProblemLanguageResultExecution timeMemory
1223508banganRarest Insects (IOI22_insects)C++20
10 / 100
104 ms436 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; #define pb push_back int min_cardinality(int N) { vector<int> all; for (int i=0; i<N; i++) all.pb(i); int ans = N; while (!all.empty()) { vector<int> rem, in; int cur = 0; while (!all.empty()) { int i = all.back(); all.pop_back(); move_inside(i); int res = press_button(); if (res == cur) { move_outside(i); rem.pb(i); } else { in.pb(i); } cur = res; } ans = min(ans, cur); all = rem; for (int IN : in) move_outside(IN); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...