Submission #818845

#TimeUsernameProblemLanguageResultExecution timeMemory
818845Faisal_SaqibCarnival (CEOI14_carnival)C++17
20 / 100
84 ms208 KiB
#include <iostream> #include <set> #include <vector> using namespace std; int main() { int n; cin>>n; int c=1; int val[n+3]; set<int> left; for(int i=1;i<=n;i++) { val[i]=-1; left.insert(i); } for(int i=1;i<=n;i++) { if(val[i]!=-1) continue; val[i]=c; left.erase(i); vector<int> rem; for(auto j:left) { cout<<2<<' '<<i<<' '<<j<<endl; int dif; cin>>dif; if(dif==1) { val[j]=val[i]; rem.push_back(j); } } for(auto j:rem) { left.erase(j); } c++; } cout<<0; for(int i=1;i<=n;i++) { cout<<' '<<val[i]; } cout<<endl; return 0; }
#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...