Submission #752693

#TimeUsernameProblemLanguageResultExecution timeMemory
752693MSK17Carnival (CEOI14_carnival)C++14
0 / 100
7 ms208 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...