# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
99265 | duy_tran | 사육제 (CEOI14_carnival) | C++14 | 34 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int maxn=(int)200;
int n,chk[maxn];
vector<int> a;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;++i)
{
int cnt=0;
a.clear();
a.push_back(0);
for(int j=1;j<=n;++j)
{
if(!chk[j])
{
a.push_back(j);
++cnt;
}
}
cout<<cnt<<" ";
for(int j=1;j<a.size();++j)cout<<a[j]<<" ";
cout<<endl;
fflush(stdout);
int c;
cin>>c;
if(c==1)
{
for(int j=1;j<a.size();++j)chk[a[j]]=1;
cout<<0<<" ";
for(int j=1;j<=n;++j)cout<<chk[j]<<" ";
cout<<endl;
fflush(stdout);
exit(0);
}
else
{
int l=1;int r=a.size()-1;
int mid;
while(l<=r)
{
mid=(l+r)/2;
int nc;
cout<<mid<<" ";
for(int j=1;j<=mid;++j)cout<<a[j]<<" ";
cout<<endl;
fflush(stdout);
cin>>nc;
if(nc<c-1)l=mid+1;
else r=mid-1;
}
chk[a[l]]=c;
for(int j=a[l]+1;j<=n;++j)
{
if(!chk[j])
{
cout<<2<<" ";
cout<<a[l]<<" "<<j<<endl;
fflush(stdout);
int cc;
cin>>cc;
if(cc==1)chk[j]=chk[a[l]];
}
}
}
}
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |