Submission #534641

#TimeUsernameProblemLanguageResultExecution timeMemory
534641katwamiawCarnival (CEOI14_carnival)C++14
100 / 100
22 ms300 KiB
#include<bits/stdc++.h> #define ll long long using namespace std ; //fflush(stdout) ; const int max_n=159 ; int c[max_n] ; vector<int>v[max_n] ; int r=1 ; int main(){ int n ; cin >> n ; //for(int i=1 ; i<=n ; i++) c[i]=200 ; int r=1 ; v[1].push_back(1) ; for(int i=2 ; i<=n ; i++){ cout << r+1 << ' '; for(int j=1 ; j<=r ; j++){ cout << v[j][0] << ' ' ; } cout << i << '\n' ; fflush(stdout) ; int x ; cin >> x ; if(x>r){ r++ ; v[r].push_back(i) ; } else{ for(int j=1 ; j<=r ; j++){ cout << "2 " << v[j][0] << ' ' << i << '\n' ; fflush(stdout) ; int y ; cin >> y ; if(y==1){ v[j].push_back(i) ; break ; } } } } for(int i=1 ; i<=r ; i++){ for(int j:v[i]){ c[j]=i ; } } cout << 0 << ' ' ; for(int i=1 ; i<=n ; i++) cout << c[i] << ' ' ; }
#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...