제출 #1265712

#제출 시각아이디문제언어결과실행 시간메모리
1265712codergRarest Insects (IOI22_insects)C++20
0 / 100
0 ms408 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; int min_cardinality(int N) { int m = N; vector<int> pf; pf.reserve(N); vector<bool> ty(N, false); for (int i = 0; i < N; i++) { if (ty[i]) continue; for (auto x : pf) move_outside(x); pf.clear(); move_inside(i); pf.push_back(i); ty[i] = true; int current_types = press_button(); for (int j = i + 1; j < N; j++) { if (ty[j]) continue; move_inside(j); int new_count = press_button(); if (new_count == current_types) { pf.push_back(j); ty[j] = true; } else { move_outside(j); } } int cardinality = pf.size(); m = min(m, cardinality); if (m == 1) break; } return m; return m; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...