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;
typedef vector<int> vi;
int min_cardinality(int n) {
vi T(n), C(n, 1);
for(int i = 0; i < n; i++) T[i] = i;
for(int i = 0; i < n-1; i++) {
if(T[i] != i) continue;
move_inside(i);
for(int j = i+1; j < n; j++) {
if(T[i] != i) continue;
move_inside(j);
int t = press_button();
if(t == 2) T[j] = T[i], C[i]++, C[j] = n;
move_outside(j);
}
move_outside(i);
}
int mn = n;
for(auto x : C) mn = min(x, mn);
return mn;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |