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 <stdio.h>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <bitset>
#include <map>
#include <set>
#include <tuple>
#include <string.h>
#include <math.h>
#include <random>
#include <functional>
#include <assert.h>
#include <math.h>
#define all(x) (x).begin(), (x).end()
#define xx first
#define yy second
using namespace std;
template<typename T, typename Pr = less<T>>
using pq = priority_queue<T, vector<T>, Pr>;
using i64 = long long int;
using ii = pair<int, int>;
using ii64 = pair<i64, i64>;
int min_cardinality(int n)
{
bool used[2005] = { false, };
int ans = n;
for (int i = 0; i < n; i++)
{
if (used[i])
continue;
used[i] = true;
vector<int> v = { i, };
move_inside(i);
int now = 1;
for (int j = i + 1; j < n; j++)
{
if (used[j])
continue;
move_inside(j);
now++;
if (press_button() != now)
{
move_outside(j);
now--;
continue;
}
v.push_back(j);
used[j] = true;
}
ans = min(ans, now);
for (auto& vi : v)
move_outside(vi);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |