#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[i]=c[j] ;
}
else{
c[j]=c[i] ;
}
}
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 |
81 ms |
200 KB |
Integer 121 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
60 ms |
200 KB |
Integer 116 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
61 ms |
200 KB |
Partially correct |
2 |
Incorrect |
77 ms |
200 KB |
Integer 123 violates the range [1, 8] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
87 ms |
200 KB |
Integer 111 violates the range [1, 4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
109 ms |
256 KB |
Integer 75 violates the range [1, 2] |
2 |
Halted |
0 ms |
0 KB |
- |