#include<bits/stdc++.h>
#define ll long long
using namespace std ;
//fflush(stdout) ;
const int max_n=159 ;
int c[max_n] ;
vector<int>v[max_n] ;
int r=1 ;
int main(){
int n ; cin >> n ;
//for(int i=1 ; i<=n ; i++) c[i]=200 ;
int r=1 ;
v[1].push_back(1) ;
for(int i=2 ; i<=n ; i++){
cout << r+1 << ' ';
for(int j=1 ; j<=r ; j++){
cout << v[j][0] << ' ' ;
}
cout << i << '\n' ;
fflush(stdout) ;
int x ; cin >> x ;
if(x>r){
r++ ;
v[r].push_back(i) ;
}
else{
for(int j=1 ; j<=r ; j++){
cout << "2 " << v[j][0] << ' ' << i << '\n' ;
fflush(stdout) ;
int y ; cin >> y ;
if(y==1){
v[j].push_back(i) ;
break ;
}
}
}
}
for(int i=1 ; i<=r ; i++){
for(int j:v[i]){
c[j]=i ;
}
}
cout << 0 << ' ' ;
for(int i=1 ; i<=n ; i++) cout << c[i] << ' ' ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
200 KB |
Output is correct |
2 |
Correct |
17 ms |
200 KB |
Output is correct |
3 |
Correct |
13 ms |
300 KB |
Output is correct |
4 |
Correct |
5 ms |
200 KB |
Output is correct |
5 |
Correct |
3 ms |
200 KB |
Output is correct |
6 |
Correct |
4 ms |
200 KB |
Output is correct |
7 |
Correct |
11 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
200 KB |
Output is correct |
2 |
Correct |
15 ms |
288 KB |
Output is correct |
3 |
Correct |
6 ms |
296 KB |
Output is correct |
4 |
Correct |
9 ms |
200 KB |
Output is correct |
5 |
Correct |
4 ms |
200 KB |
Output is correct |
6 |
Correct |
4 ms |
292 KB |
Output is correct |
7 |
Correct |
6 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
200 KB |
Output is correct |
2 |
Correct |
8 ms |
292 KB |
Output is correct |
3 |
Correct |
19 ms |
200 KB |
Output is correct |
4 |
Correct |
7 ms |
200 KB |
Output is correct |
5 |
Correct |
4 ms |
200 KB |
Output is correct |
6 |
Correct |
4 ms |
296 KB |
Output is correct |
7 |
Correct |
7 ms |
292 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
300 KB |
Output is correct |
2 |
Correct |
8 ms |
200 KB |
Output is correct |
3 |
Correct |
15 ms |
200 KB |
Output is correct |
4 |
Correct |
4 ms |
200 KB |
Output is correct |
5 |
Correct |
7 ms |
292 KB |
Output is correct |
6 |
Correct |
6 ms |
200 KB |
Output is correct |
7 |
Correct |
21 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
300 KB |
Output is correct |
2 |
Correct |
14 ms |
200 KB |
Output is correct |
3 |
Correct |
21 ms |
296 KB |
Output is correct |
4 |
Correct |
22 ms |
292 KB |
Output is correct |
5 |
Correct |
5 ms |
200 KB |
Output is correct |
6 |
Correct |
3 ms |
200 KB |
Output is correct |
7 |
Correct |
5 ms |
296 KB |
Output is correct |