#include "insects.h"
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
const int MAXN = 2048;
int n;
int used[MAXN];
int min_cardinality(int N)
{
n = N;
int ans = 1e9;
vector<pair<int,int> >p;
for(int i = 0; i < n; i++)
{
move_inside(i);
bool f = false;
for(int j = 0; j < p.size(); j++)
{
pair<int,int>nb = p[j];
move_inside(nb.second);
int pb = press_button();
move_outside(nb.second);
if(pb == 2)
{
nb.first++;
p[j] = nb;
f = true;
}
if(f) break;
}
if(!f) p.push_back({1,i});
move_outside(i);
sort(p.begin(),p.end());
reverse(p.begin(),p.end());
//cout << "after i : " << i << endl;
//for(pair<int,int> nb : p) cout << nb.first << " " << nb.second << endl;
}
return p.back().first;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |