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<int> card(N, -1);
for(int i = 0; i < N; i++)
{
if(card[i] == -1)
{
move_inside(i);
vector<int> machine = {i};
for(int j = 0; j < N; j++)
{
if(card[j] == -1 && i != j)
{
move_inside(j);
machine.push_back(j);
if(press_button() < (int) machine.size())
{
move_outside(j);
machine.pop_back();
}
}
}
for(int j : machine)
{
card[j] = machine.size();
}
}
}
return *min_element(card.begin(), card.end());
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |