# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26512 | 2017-07-01T20:22:19 Z | Nirjhor | Carnival (CEOI14_carnival) | C++14 | 9 ms | 2020 KB |
#include <bits/stdc++.h> using namespace std; const int N = 155; int n, sz; vector <int> v; int color[N]; bitset <N> done; int main() { cin >> n; v.push_back(1); sz = 1, done[1] = 1; for (int i = 2; i <= n; ++i) { cout << sz + 1 << " "; for (int x : v) { cout << x << " "; } cout << i << endl; int distinct; cin >> distinct; if (distinct == sz + 1) { ++sz, done[i] = 1; v.push_back(i); } } for (int i = 0; i < sz; ++i) { color[v[i]] = i + 1; } for (int i = 1; i <= n; ++i) { if (done[i]) continue; int lo = 0, hi = sz - 1; while (lo < hi) { int mid = lo + hi >> 1; cout << mid - lo + 2 << " "; for (int j = lo; j <= mid; ++j) { cout << v[j] << " "; } cout << i << endl; int distinct; cin >> distinct; if (distinct == mid - lo + 2) { lo = mid + 1; } else { hi = mid; } } color[i] = color[v[lo]]; } cout << "0"; for (int i = 1; i <= n; ++i) { cout << " " << color[i]; } cout << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 9 ms | 2020 KB | Output is correct |
3 | Correct | 0 ms | 2020 KB | Output is correct |
4 | Correct | 3 ms | 2020 KB | Output is correct |
5 | Correct | 3 ms | 2020 KB | Output is correct |
6 | Correct | 3 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 0 ms | 2020 KB | Output is correct |
3 | Correct | 3 ms | 2020 KB | Output is correct |
4 | Correct | 3 ms | 2020 KB | Output is correct |
5 | Correct | 6 ms | 2020 KB | Output is correct |
6 | Correct | 3 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 6 ms | 2020 KB | Output is correct |
3 | Correct | 0 ms | 2020 KB | Output is correct |
4 | Correct | 6 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 3 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 6 ms | 2020 KB | Output is correct |
3 | Correct | 6 ms | 2020 KB | Output is correct |
4 | Correct | 0 ms | 2020 KB | Output is correct |
5 | Correct | 3 ms | 2020 KB | Output is correct |
6 | Correct | 0 ms | 2020 KB | Output is correct |
7 | Correct | 3 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 6 ms | 2020 KB | Output is correct |
3 | Correct | 3 ms | 2020 KB | Output is correct |
4 | Correct | 6 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 3 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |