#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
using namespace std;
vector<int>adj[200001];
int vs[151]; int c;
void dfs(int x){
vs[x] = c;
for(auto s:adj[x]){
if(!vs[s]){
vs[s] = c;
dfs(s);
}
}
}
signed main(){
int n; cin >> n;
for(int i = 0; i < n; i++){
int l = i + 1, r = n, aa = -1;
while(l <= r){
int mid = (l + r) / 2;
cout << mid - i << ' ' ;
for(int j = i; j < mid; j++){
cout << j + 1 << ' ';
}
cout << endl;
int ans; cin >> ans;
if(ans == mid - l + 1){
l = mid + 1;
aa = mid + 1;
}else{
r = mid - 1;
}
}
if(aa != -1){
adj[i].push_back(aa);
}
}
for(int i = 0; i < n; i++){
if(!vs[i]){
c++;
dfs(i);
}
}
cout << 0 << ' ' ;
for(int i = 0; i < n;i++){
cout << vs[i] << ' ';
}
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
4976 KB |
Integer 12 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
5004 KB |
Integer 6 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
4996 KB |
Integer 2 violates the range [1, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
4996 KB |
Integer 5 violates the range [1, 4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
4980 KB |
Integer 3 violates the range [1, 2] |
2 |
Halted |
0 ms |
0 KB |
- |