제출 #628881

#제출 시각아이디문제언어결과실행 시간메모리
628881dqhungdl드문 곤충 (IOI22_insects)C++17
10 / 100
385 ms304 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; int min_cardinality(int N) { vector<int> P(N, -1); int rs = 1e9; for (int i = 0; i < N; i++) if (P[i] == -1) { P[i] = i; move_inside(i); int cnt = 1; for (int j = i + 1; j < N; j++) if (P[j] == -1) { move_inside(j); if (cnt + 1 == press_button()) { cnt++; P[j] = i; } else move_outside(j); } rs = min(rs, cnt); for (int j = i; j < N; j++) if (P[j] == i) move_outside(j); } return rs; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...