# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
978172 | AlphaMale06 | Carnival (CEOI14_carnival) | C++17 | 4 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int main()
{
int n;
cin >> n;
vector<int> qry;
qry.pb(1);
int c[n+1];
c[1]=1;
for(int i=2; i<=n; i++){
qry.pb(i);
cout << qry.size();
for(int e : qry)cout << " " << e;
cout << endl;
int ans;
cin >> ans;
if(ans==qry.size()){
c[i]=qry.size();
}
else{
qry.pop_back();
int sz = qry.size();
bool mark[sz];
for(int j=0; j< sz; j++)mark[j]=0;
int cnt=sz;
while(cnt>1){
int mk = cnt>>1;
vector<int> qry1;
vector<int> kolkogej;
for(int j=0; j<sz; j++){
if(!mark[j]){
mk--;
qry1.pb(qry[j]);
kolkogej.pb(j);
}
if(mk==0)break;
}
cout << qry1.size()+1;
for(int e : qry1)cout << " " << e;
cout << " " << i << endl;
int ans1;
cin >> ans1;
if(ans1==qry1.size()+1){
for(int e : kolkogej){
mark[e]=1;
}
}
else{
for(int j=0; j<sz; j++)mark[j]=1;
for(int e : kolkogej){
mark[e]=0;
}
}
cnt=0;
for(int j=0; j< sz; j++){
if(!mark[j])cnt++;
}
}
for(int j=0; j < sz; j++){
if(!mark[j]){
c[i]=c[qry[j]];
break;
}
}
}
}
cout << 0;
for(int i=1; i<=n; i++)cout << " " << c[i];
cout << endl;
}
컴파일 시 표준 에러 (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... |