Submission #383239

#TimeUsernameProblemLanguageResultExecution timeMemory
383239mariowongCarnival (CEOI14_carnival)C++14
20 / 100
128 ms364 KiB
#include <bits/stdc++.h> using namespace std; int n,ans[155],x,ct; int main(){ ios::sync_with_stdio(false); cin >> n; for (int i=1;i<=n;i++){ ans[i]=-1; } for (int i=1;i<=n;i++){ if (ans[i] == -1){ ct++; ans[i]=ct; } for (int j=i+1;j<=n;j++){ cout << "2 " << i << " " << j << "\n"; fflush(stdout); cin >> x; if (x == 1) ans[j]=ans[i]; } } cout << "0 "; for (int i=1;i<=n;i++){ cout << ans[i] << " "; } cout << "\n"; fflush(stdout); 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...