This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
using namespace std;
int n;
vector <int> v(200, 1);
vector <int> d(200, 1);
int query(int x, int r) {
for (int i = 1; i <= r; i++) cout << i << " ";
cout << x << endl;
cin >> x;
return x;
}
void solve(int x) {
int l = 0, r = x, m;
while (r - l > 1) {
m = (l + r) / 2;
query(x, m) > d[m] ? l = m : r = m;
}
v[x] = r;
d[x] = d[x - 1] + (v[x] == x);
}
int main() {
cin >> n;
for (int i = 2; i <= n; i++) solve(i);
for (int i = 1; i <= n; i++) cout << v[i] << " ";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |