# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
837756 | kshitij_sodani | Rarest Insects (IOI22_insects) | C++17 | 60 ms | 552 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define a first
#define b second
#define pb push_back
typedef long long llo;
#define endl '\n'
#include "insects.h"
#define in move_inside
#define out move_outside
#define query press_button
int d;
int query(int l,int r,vector<int> aa,vector<int> bb){
//cout<<l<<":"<<r<<endl;
if(l==r){
return l;
}
int mid=(l+r+1)/2;
vector<int> cc;
vector<int> dd;
for(auto j:bb){
in(j);
cc.pb(j);
if(query()>mid){
out(j);
cc.pop_back();
dd.pb(j);
}
}
if(aa.size()+cc.size()!=mid*d){
for(auto j:cc){
out(j);
}
return query(l,mid-1,aa,cc);
}
for(auto j:cc){
aa.pb(j);
}
return query(mid,r,aa,dd);
}
int min_cardinality(int n) {
vector<int> ss;
vector<int> tt;
for(int i=0;i<n;i++){
in(i);
ss.pb(i);
if(query()==2){
out(i);
tt.pb(i);
ss.pop_back();
}
}
d=ss.size();
if(ss.size()==n){
return 1;
}
if(ss.size()==1){
return n;
}
int x=query(1,n/(ss.size()),ss,tt);
return x;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |