#include<bits/stdc++.h>
#define ll long long
using namespace std ;
//fflush(stdout) ;
const int max_n=159 ;
int c[max_n] ;
int main(){
int n ; cin >> n ;
for(int i=1 ; i<=n ; i++) c[i]=-1 ;
int r=1 ;
for(int i=1 ; i<n ; i++){
for(int j=i+1 ; j<=n ; j++){
cout << "2 " << i << ' ' << j << '\n' ;
fflush(stdout) ;
int x ; cin >> x ;
if(x==1){
if(c[i]==-1&&c[j]==-1){
c[i]=r ;
c[j]=r ;
r++ ;
}
else if(c[i]<c[j]){
c[j]=c[i] ;
}
else if(c[j]<c[i]){
c[i]=c[j] ;
}
}
else{
if(c[i]==-1&&c[j]==-1){
c[i]=r ;
r++ ;
c[j]=r ;
r++ ;
}
else if(c[i]==-1){
c[i]=r ;
r++ ;
}
else if(c[j]==-1){
c[j]=r ;
r++ ;
}
}
}
}
cout << 0 << ' ' ;
for(int i=1 ; i<=n ; i++) cout << c[i] << ' ' ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
73 ms |
200 KB |
Integer 133 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
102 ms |
200 KB |
Integer 139 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
91 ms |
200 KB |
Integer -1 violates the range [1, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
51 ms |
200 KB |
Integer -1 violates the range [1, 4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
95 ms |
200 KB |
Integer -1 violates the range [1, 2] |
2 |
Halted |
0 ms |
0 KB |
- |