이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
int min_cardinality(int N) {
int n = N;
vector<bool> removed(n);
while (true) {
set<int> to_remove;
int not_removed = 0;
for (int i = 0; i < n; ++i) {
if (!removed[i]) {
move_inside(i);
not_removed++;
}
}
int x = press_button();
if (x == 1 || x == not_removed) return x;
for (int i = 0; i < n; ++i) {
if (!removed[i]) {
move_outside(i);
int y = press_button();
if (y < x) {
move_inside(i);
to_remove.insert(i);
}
}
}
for (int i : to_remove) {
move_outside(i);
removed[i] = true;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |