제출 #1124176

#제출 시각아이디문제언어결과실행 시간메모리
1124176epicci23드문 곤충 (IOI22_insects)C++17
0 / 100
0 ms420 KiB
#include "insects.h" #include "bits/stdc++.h" using namespace std; vector<int> v; int D; void Clear(){ while(!v.empty()){ move_outside(v.back()); v.pop_back(); } } int min_cardinality(int n){ v.push_back(0); move_inside(0); for(int i=1;i<n;i++){ v.push_back(i); move_inside(i); int u = press_button(); if(u == 1) continue; move_outside(i); v.pop_back(); } D = v.size(); if(D > n / 2) return 1; int _n = n; while(1){ int B = _n / D; Clear(); for(int i=0;i<=B;i++){ v.push_back(i); move_inside(i); } for(int i=B+1;i<n;i++){ v.push_back(i); move_inside(i); int u = press_button(); if(u > B){ move_outside(i); v.pop_back(); } } if(v.size() == B * D) return B; _n = v.size(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...