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 <bits/stdc++.h>
#include "insects.h"
using namespace std;
int min_cardinality(int n) {
vector <bool> vis (n);
int tp = 0;
for (int i = 0; i < n; i++){
move_inside(i);
if (press_button() == 2) {
move_outside(i);
}
else {
vis[i] = 1;
tp++;
}
}
for (int i = 2; i <= n; i++){
int d = 0;
for (int j = 0; j < n; j++){
if (vis[j]) continue;
move_inside(j);
if (press_button() == i + 1) {
move_outside(j);
}
else {
vis[j] = 1;
d++;
}
}
if (d != tp) return i-1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |