#include <bits/stdc++.h>
using namespace std;
const int N = 153;
vector <int> v;
int n, co[N], resp;
int cnt = 1, l, r;
void proc(int w){
l = 0, r = v.size()-1;
while(l < r){
//cout << l << ' ' << r << " ENDPOINTS" << endl;
int mid = (l+r)/2;
cout << (mid-l+2) << ' ';
for (int i = l; i <= mid; i++){
cout << v[i] << ' ';
}
cout << w << endl;
cin >> resp;
if (resp == (mid-l+1)){
r = mid;
} else {
l = mid+1;
}
}
co[w] = co[v[l]];
}
int main(){
//ios_base::sync_with_stdio(false);
//cin.tie(NULL); cout.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++){
cout << i << ' ';
for (int j = 1; j <= i; j++){
cout << j << ' ';
}
cout << endl;
cin >> resp;
if (resp == (int)v.size() + 1){
co[i] = cnt;
cnt++;
v.push_back(i);
} else {
proc(i);
}
}
cout << 0 << ' ';
for (int i = 1; i <= n; i++){
cout << co[i] << ' ';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
208 KB |
Output is correct |
2 |
Correct |
7 ms |
208 KB |
Output is correct |
3 |
Correct |
5 ms |
208 KB |
Output is correct |
4 |
Correct |
2 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
4 ms |
208 KB |
Output is correct |
7 |
Correct |
8 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
208 KB |
Output is correct |
2 |
Correct |
8 ms |
208 KB |
Output is correct |
3 |
Correct |
2 ms |
208 KB |
Output is correct |
4 |
Correct |
3 ms |
208 KB |
Output is correct |
5 |
Correct |
8 ms |
208 KB |
Output is correct |
6 |
Correct |
7 ms |
208 KB |
Output is correct |
7 |
Correct |
7 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
5 ms |
208 KB |
Output is correct |
3 |
Correct |
7 ms |
208 KB |
Output is correct |
4 |
Correct |
3 ms |
208 KB |
Output is correct |
5 |
Correct |
7 ms |
208 KB |
Output is correct |
6 |
Correct |
5 ms |
208 KB |
Output is correct |
7 |
Correct |
7 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
208 KB |
Output is correct |
2 |
Correct |
6 ms |
208 KB |
Output is correct |
3 |
Correct |
4 ms |
208 KB |
Output is correct |
4 |
Correct |
4 ms |
208 KB |
Output is correct |
5 |
Correct |
7 ms |
208 KB |
Output is correct |
6 |
Correct |
7 ms |
208 KB |
Output is correct |
7 |
Correct |
9 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
208 KB |
Output is correct |
2 |
Correct |
9 ms |
208 KB |
Output is correct |
3 |
Correct |
7 ms |
208 KB |
Output is correct |
4 |
Correct |
6 ms |
212 KB |
Output is correct |
5 |
Correct |
6 ms |
208 KB |
Output is correct |
6 |
Correct |
5 ms |
208 KB |
Output is correct |
7 |
Correct |
4 ms |
208 KB |
Output is correct |