| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 786144 | vjudge1 | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
// void move_inside(int);
// void move_outside(int);
// int press_button();
int min_cardinality(int N)
{
vector<int> types(N, -1);
int t = 0;
for (int i = 0; i < N; i++) {
if (types[i] != -1)
continue;
types[i] = t;
move_inside(i);
for (int j = i + 1; j < N; j++) {
move_inside(j);
int ret = press_button();
if (ret > 1)
types[j] = t;
move_outside(j);
}
t++;
}
vector<int> cnt(t);
for (int i = 0; i < N; i++)
cnt[types[i]]++;
int mn = cnt[0];
for (auto x : cnt)
if (x < mn)
mn = x;
return mn;
}
