| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1229998 | yixuan19 | 사육제 (CEOI14_carnival) | C++20 | 2 ms | 412 KiB |
#include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> sol(N+1);
vector<int> unique;
int res;
sol[1] = 1;
unique.push_back(1);
for (int i = 2; i <= N; ++i){
cout<<unique.size()+1<<' ';
for (int in: unique){
cout<<in<<' ';
}
cout<<i<<endl;
cin >> res;
if (res > unique.size()){
sol[i] = res;
unique.push_back(i);
}else{
int l = 0;
int r = unique.size()-1;
while (l < r){
//cout<<"l "<<l<<" r "<<r<<endl;
int m = (l+r)/2;
cout<<m-l+2<<' ';
for (int j = l; j <= m; ++j){
cout<<unique[j]<<' ';
}
cout<<i<<endl;
cin >> res;
if (res == m-l+2){
l = m+1;
}else{
r = m;
}
}
sol[i] = sol[unique[l]];
}
}
cout<<0<<' ';
for (int i = 1; i <= N; ++i){
cout<<sol[i]<<' ';
}
cout<<endl;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
