#include <iostream>
#include <vector>
using namespace std;
const int N = 160;
int n, a, b, pos, mid, res, prv, now;
int ans[N];
vector <int> v;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n;
for(int i = 1; i <= n; i++) {
cout << i << ' ';
for(int j = 1; j <= i; j++) {
cout << j << ' ';
}
cout << endl;
cin >> now;
if(now != prv) {
v.push_back(i);
ans[i] = now;
prv = now;
continue;
}
a = 0, b = v.size() - 1;
while(a != b) {
mid = (a+b) / 2;
cout << mid + 2 << ' ';
for(int i = 0; i <= mid; i++) {
cout << v[i] << ' ';
}
cout << i << endl;
cin >> res;
if(res < mid + 2) {
b = mid - 1;
pos = mid;
}
else {
a = mid + 1;
}
}
ans[i] = ans[v[pos]];
}
for(int i = 0; i <= n; i++) {
cout << ans[i] << ' ';
}
cout << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
99 ms |
296 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
93 ms |
292 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Runtime error |
89 ms |
296 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
82 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
95 ms |
296 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |