# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
727254 | nasir_bashirov | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 0 KiB |
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;
#define endl '\n'
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define all(x) x.begin(), x.end()
#define fastio\
ios_base::sync_with_stdio(0);\
cin.tie(0);\
cout.tie(0)\
int min_cardinality(int n){
vi cnt(n, 0);
for(int i = 0; i < n; i++){
move_inside(i);
for(int j = i + 1; j < n; j++){
move_inside(j);
int mx = press_buton();
if(mx > 1){
cnt[i]++;
}
move_outside(j);
}
move_outside(i);
}
int res = 1e9;
for(int i : cnt){
res = min(res, i);
}
return res;
}