이 제출은 이전 버전의 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);
if(p[i-1].second!=p[i].second){
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].second]=a[p[i].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;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |