# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
702797 | Halogen | Carnival (CEOI14_carnival) | C++14 | 8 ms | 304 KiB |
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 <bits/stdc++.h>
using namespace std;
vector<int> group[200];
int check(int x, int y, int test) {
cout << y - x + 2 << ' ' << test << ' ';
for (int i = x; i <= y; i++) {
cout << group[i][0] << ' ';
}
cout << endl;
int res; cin >> res;
return res != y - x + 1;
}
int main() {
int N; cin >> N;
int cnt = 1;
group[1].push_back(1);
for (int i = 2; i <= N; ++i) {
if (check(1, cnt, i)) {
group[++cnt].push_back(i);
continue;
}
int l = 1, r = cnt - 1;
while(l <= r) {
int m = l + r >> 1;
if (check(l, m, i)) l = m + 1;
else r = m - 1;
}
group[l].push_back(i);
}
int ans[200];
for (int i = 1; i <= cnt; i++) {
for (int k : group[i]) ans[k] = i;
}
cout << "0 ";
for (int i = 1; i <= N; i++) cout << ans[i] << ' ';
cout << endl;
}
Compilation message (stderr)
# | 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... |