# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
347277 | 2021-01-12T13:34:54 Z | maomao90 | Carnival (CEOI14_carnival) | C++14 | 9 ms | 492 KB |
// https://oj.uz/problem/view/CEOI14_carnival #include <bits/stdc++.h> using namespace std; #define REP(i, j, k) for (int i = j; i < k; i++) #define pb push_back int n; int ans[155]; vector<int> used; int main() { scanf("%d", &n); ans[0] = 0; used.pb(0); REP (i, 1, n) { printf("%d", i + 1); REP (j, 0, i + 1) printf(" %d", j + 1); printf("\n"); fflush(stdout); int all; scanf("%d", &all); if (all > used.size()) { used.pb(i); ans[i] = all - 1; } else { int lo = 0, hi = used.size() - 1, mid; while (lo < hi) { mid = hi + lo + 1 >> 1; printf("%d", mid - lo + 1); REP (i, lo, mid) printf(" %d", used[i] + 1); printf(" %d\n", i + 1); fflush(stdout); int cur; scanf("%d", &cur); if (cur == mid - lo) { hi = mid - 1; } else { lo = mid; } } ans[i] = hi; } } printf("0"); REP (i, 0, n) printf(" %d", ans[i] + 1); printf("\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 364 KB | Output is correct |
2 | Correct | 9 ms | 364 KB | Output is correct |
3 | Correct | 6 ms | 364 KB | Output is correct |
4 | Correct | 3 ms | 364 KB | Output is correct |
5 | Correct | 3 ms | 364 KB | Output is correct |
6 | Correct | 4 ms | 364 KB | Output is correct |
7 | Correct | 8 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 364 KB | Output is correct |
2 | Correct | 9 ms | 364 KB | Output is correct |
3 | Correct | 4 ms | 364 KB | Output is correct |
4 | Correct | 3 ms | 364 KB | Output is correct |
5 | Correct | 6 ms | 364 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
7 | Correct | 7 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 364 KB | Output is correct |
2 | Correct | 8 ms | 364 KB | Output is correct |
3 | Correct | 8 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 364 KB | Output is correct |
5 | Correct | 6 ms | 364 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
7 | Correct | 8 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 492 KB | Output is correct |
2 | Correct | 6 ms | 364 KB | Output is correct |
3 | Correct | 5 ms | 364 KB | Output is correct |
4 | Correct | 3 ms | 364 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 7 ms | 364 KB | Output is correct |
7 | Correct | 8 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 364 KB | Output is correct |
2 | Correct | 8 ms | 364 KB | Output is correct |
3 | Correct | 7 ms | 364 KB | Output is correct |
4 | Correct | 8 ms | 364 KB | Output is correct |
5 | Correct | 4 ms | 364 KB | Output is correct |
6 | Correct | 5 ms | 364 KB | Output is correct |
7 | Correct | 4 ms | 364 KB | Output is correct |