| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 683374 | irmuun | 드문 곤충 (IOI22_insects) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "insects.h"
using namespace std;
int a[2005];
int min_cardinality(int n){
pair<int,int>p[n*n+5];
p[0].first=0;
p[0].second=0;
int tot=0;
for(int i=0;i<n;i++){
a[i]=i;
for(int j=i+1;j<n;j++){
tot++;
p[tot].first=i;
p[tot].second=j;
}
}
for(int i=1;i<=tot;i++){
move_outside(p[i-1].first);
move_outside(p[i-1].second);
move_inside(p[i].first);
move_inside(p[i].second);
int x=press_button();
if(x==2){
a[p[i].first]=a[p[j].first];
}
}
int ans=0;
for(int i=0;i<n;i++){
int cur=0;
for(int j=0;j<n;j++){
if(a[j]==i){
cur++;
}
}
ans=max(ans,cur);
}
return ans;
}
