This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |