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>
//#include "stub.cpp"
using namespace std;
int n;
set<int> st;
map<int,int> mp;
int min_cardinality(int N) {
n = N;
int mini = n;
for(int i=0; i<n; i++) st.insert(i);
while(st.size()) {
int cnt = 1, i = (*st.begin());
st.erase(st.begin());
if(st.size()) move_inside(i);
vector<int> e;
for(auto it:st) {
move_inside(it);
int g = press_button();
if(g==2) {
cnt++;
e.push_back(it);
}
move_outside(it);
}
if(st.size()) move_outside(i);
mini = min(mini, cnt);
for(auto it:e) st.erase(it);
}
return mini;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |