This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |