# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
253406 | 2020-07-28T02:11:56 Z | ChrisT | Carnival (CEOI14_carnival) | C++17 | 10 ms | 384 KB |
#include<bits/stdc++.h> using namespace std; vector<vector<int>> ret; int getpos (int i, int l, int r) { if (l == r) return l; int mid = (l + r) / 2; printf ("%d ",mid-l+2); for (int j = l; j <= mid; j++) printf ("%d ",ret[j].back()); printf ("%d\n",i); fflush(stdout); int go; scanf ("%d",&go); if (go == mid - l + 1) return getpos(i,l,mid); else return getpos(i,mid+1,r); } int main () { int n; scanf ("%d",&n); ret = {{1}}; for (int i = 2; i <= n; i++) { printf ("%d ",i); for (int j = 1; j <= i; j++) printf("%d%c",j," \n"[j==i]); fflush(stdout); int new_cnt; scanf ("%d",&new_cnt); if (new_cnt > (int)ret.size()) ret.push_back({i}); else ret[getpos(i,0,(int)ret.size()-1)].push_back(i); } vector<int> ans(n+1); for (int i = 0; i < (int)ret.size(); i++) { for (int j : ret[i]) ans[j] = i+1; } printf ("0 "); for (int i = 1; i <= n; i++) printf ("%d%c",ans[i]," \n"[i==n]); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 256 KB | Output is correct |
2 | Correct | 7 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 256 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 256 KB | Output is correct |
6 | Correct | 4 ms | 256 KB | Output is correct |
7 | Correct | 8 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 256 KB | Output is correct |
2 | Correct | 8 ms | 256 KB | Output is correct |
3 | Correct | 4 ms | 256 KB | Output is correct |
4 | Correct | 3 ms | 256 KB | Output is correct |
5 | Correct | 9 ms | 256 KB | Output is correct |
6 | Correct | 7 ms | 256 KB | Output is correct |
7 | Correct | 7 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 6 ms | 256 KB | Output is correct |
3 | Correct | 7 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 6 ms | 256 KB | Output is correct |
6 | Correct | 7 ms | 256 KB | Output is correct |
7 | Correct | 6 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 6 ms | 256 KB | Output is correct |
3 | Correct | 5 ms | 256 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 8 ms | 256 KB | Output is correct |
6 | Correct | 8 ms | 384 KB | Output is correct |
7 | Correct | 10 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 256 KB | Output is correct |
2 | Correct | 6 ms | 256 KB | Output is correct |
3 | Correct | 7 ms | 256 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 6 ms | 256 KB | Output is correct |
7 | Correct | 3 ms | 384 KB | Output is correct |