# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48131 | 2018-05-10T06:38:08 Z | jeff | Carnival (CEOI14_carnival) | C++14 | 8 ms | 608 KB |
#include <bits/stdc++.h> using namespace std; int id[150], rk[150], sr[150]; vector<int> tor; int main() { int N, l, h, m, c, t = 0, i, j; scanf("%d", &N); for (i = 0; i < N; ++i) id[i] = i; for (i = 0; i < N; ++i) { printf("%d ", tor.size() + 1); for (j = 0; j < tor.size(); ++j) printf("%d ", tor[j] + 1); printf("%d\n", i + 1); fflush(stdout); scanf("%d", &c); if (c <= tor.size()) { l = 0; h = tor.size() - 1; while (l < h) { m = (l + h) / 2; printf("%d ", m - l + 2); for (j = l; j < m + 1; ++j) printf("%d ", tor[j] + 1); printf("%d\n", i + 1); fflush(stdout); scanf("%d", &c); (c <= m - l + 1 ? h : l) = m + (c > m - l + 1); } id[i] = tor[(l + h) / 2]; } else tor.push_back(i); } printf("0 "); for (i = 0; i < N; ++i) { if (i == id[i]) sr[i] = ++t; printf("%d%c", sr[id[i]], i < N - 1 ? ' ' : '\n'); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 376 KB | Output is correct |
3 | Correct | 5 ms | 496 KB | Output is correct |
4 | Correct | 4 ms | 496 KB | Output is correct |
5 | Correct | 4 ms | 496 KB | Output is correct |
6 | Correct | 4 ms | 608 KB | Output is correct |
7 | Correct | 6 ms | 608 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 608 KB | Output is correct |
2 | Correct | 8 ms | 608 KB | Output is correct |
3 | Correct | 4 ms | 608 KB | Output is correct |
4 | Correct | 4 ms | 608 KB | Output is correct |
5 | Correct | 4 ms | 608 KB | Output is correct |
6 | Correct | 5 ms | 608 KB | Output is correct |
7 | Correct | 6 ms | 608 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 608 KB | Output is correct |
2 | Correct | 5 ms | 608 KB | Output is correct |
3 | Correct | 5 ms | 608 KB | Output is correct |
4 | Correct | 4 ms | 608 KB | Output is correct |
5 | Correct | 5 ms | 608 KB | Output is correct |
6 | Correct | 6 ms | 608 KB | Output is correct |
7 | Correct | 6 ms | 608 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 608 KB | Output is correct |
2 | Correct | 4 ms | 608 KB | Output is correct |
3 | Correct | 5 ms | 608 KB | Output is correct |
4 | Correct | 4 ms | 608 KB | Output is correct |
5 | Correct | 6 ms | 608 KB | Output is correct |
6 | Correct | 6 ms | 608 KB | Output is correct |
7 | Correct | 7 ms | 608 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 608 KB | Output is correct |
2 | Correct | 6 ms | 608 KB | Output is correct |
3 | Correct | 6 ms | 608 KB | Output is correct |
4 | Correct | 4 ms | 608 KB | Output is correct |
5 | Correct | 7 ms | 608 KB | Output is correct |
6 | Correct | 5 ms | 608 KB | Output is correct |
7 | Correct | 4 ms | 608 KB | Output is correct |