제출 #652935

#제출 시각아이디문제언어결과실행 시간메모리
652935grt드문 곤충 (IOI22_insects)C++17
10 / 100
322 ms208 KiB
#include "insects.h" //GRT_2018 #include <bits/stdc++.h> #define PB push_back #define ST first #define ND second //mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); using namespace std; using ll = long long; using pi = pair<int,int>; using vi = vector<int>; const int nax = 2010; bool discarded[nax]; int baseLength(vi &v) { vi taken = {}; for(int x : v) { move_inside(x); taken.PB(x); int w = press_button(); if(w >= 2) { move_outside(x); taken.pop_back(); } } for(int x : taken) { move_outside(x); discarded[x] = true; } return (int)taken.size(); } int min_cardinality(int n) { vi allowed = {}; for(int i = 0; i < n; ++i) { allowed.PB(i); } int k = baseLength(allowed); for(int i = 2; i <= n; ++i) { allowed.clear(); for(int j = 0; j < n; ++j) { if(!discarded[j]) { allowed.PB(j); } } int k2 = baseLength(allowed); if(k2 < k) { return i - 1; } } return n; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...