-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1146C.cpp
More file actions
72 lines (42 loc) · 999 Bytes
/
1146C.cpp
File metadata and controls
72 lines (42 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int i=0;i<t;i++){
int n;
cin >> n;
cout << 1 << " " << n-1 << " " << 1 << " ";
for(int j=2;j<=n;j++) cout << j << " ";
cout << endl;
fflush(stdout);
int maxi;
cin >> maxi;
int ini = 2;
int fim = n;
while(fim - ini > 0){
int mid = (ini+fim)/2;//3
cout << 1 << " " << mid-ini+1 << " " << 1 << " ";
for(int j=ini;j<=mid;j++) cout << j << " ";
cout << endl;
fflush(stdout);
int ans;
cin >> ans;//9
if(ans != maxi){
ini = mid+1;
}else{
fim = mid;
}
}
int node = ini;
cout << "1 " << n-1 << " " << node << " ";
for(int j=1;j<=n;j++) if(j!=node) cout << j << " ";
cout << endl;
fflush(stdout);
int resp;
cin >> resp;
cout << "-1 " << resp << endl;
fflush(stdout);
}
return 0;
}