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;
const int N = 2e3 + 10;
bool mark[N];
int min_cardinality(int n) {
int res = n;
for(int i = 0; i < n; i++) if (!mark[i]) {
int cur = 0;
vector<int> lst;
for(int j = i; j < n; j++) if (!mark[j]) {
move_inside(j);
int nxt = press_button();
if (cur < nxt) cur = nxt, mark[j] = 1, lst.push_back(j);
else move_outside(j);
}
for(int &j : lst) move_outside(j);
res = min(res, cur);
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |