이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int min_cardinality(int n) {
vector<int> p(n);
iota(p.begin(), p.end(), 0);
for (int i = 0; i < n; i++) {
move_inside(i);
for (int j = i + 1; j < n; j++) {
move_inside(j);
if (press_button() == 2) {
p[j] = p[i];
}
move_outside(j);
}
move_outside(i);
}
vector<int> cnt(n);
for (int i = 0; i < n; i++) {
cnt[p[i]]++;
}
int ans = n;
for (int i = 0; i < n; i++) {
if (cnt[i] > 0) {
ans = min(ans, cnt[i]);
}
}
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... |