#include <bits/stdc++.h>
int main(){
int n,ind{1},last{1};
std::cin>>n;
std::vector<int> col(n+1);
std::vector<int> dist;
col[1]=ind++;
dist.push_back(1);
for(int i{2}; i <= n; ++i){
std::cout << i << std::endl;
for(int j{1}; j <= i; ++j){
std::cout << j << (j==i?"":" ");
}
std::cout << std::endl;
int input;
std::cin>>input;
if(input>last){
dist.push_back(i);
col[i]=ind++;
}
last=input;
}
for(int i{1}; i<=n; ++i){
if(col[i])
continue;
int l=0, r=dist.size()-1;
while(l<r){
int m=(l+r)/2;
std::cout << m-l+2 << std::endl;
for(int j{l}; j <= m; ++j)
std::cout << dist[j] << " ";
std::cout << i << std::endl;
int input;
std::cin>>input;
if(input==m-l+1)
r=m;
else
l=m+1;
}
col[i]=col[dist[l]];
}
for(int i{1}; i <= n; ++i)
std::cout << col[i] << (i==n?"":" ");
std::cout << std::endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
208 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
208 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
208 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
208 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
208 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |