# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25969 | 2017-06-25T09:05:33 Z | tlwpdus | Carnival (CEOI14_carnival) | C++ | 9 ms | 2020 KB |
#include <bits/stdc++.h> using namespace std; int n; int color[160]; int rep[160]; int key = 0; void bs(int idx) { int s = 1, e = key, i; while(s<e) { int m = (s+e)>>1; printf("%d ",m-s+2); for (i=s;i<=m;i++) printf("%d ",rep[i]); printf("%d\n",idx); fflush(stdout); int a; scanf("%d",&a); if (a==m-s+1) e = m; else s = m+1; } color[idx] = s; } int main() { int i, j; scanf("%d",&n); for (i=1;i<=n;i++) { printf("%d ",i); for (j=1;j<=i;j++) printf("%d ",j); printf("\n"); fflush(stdout); int val; scanf("%d",&val); if (key<val) { key=val; color[i] = key; rep[key] = i; } } for (i=1;i<=n;i++) { if (color[i]) continue; bs(i); } printf("0 "); for (i=1;i<=n;i++) printf("%d ",color[i]); printf("\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 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 | 0 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 0 ms | 2020 KB | Output is correct |
7 | Correct | 6 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 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 | 3 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 9 ms | 2020 KB | Output is correct |
7 | Correct | 3 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 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 | 9 ms | 2020 KB | Output is correct |
6 | Correct | 6 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 2020 KB | Output is correct |
2 | Correct | 3 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 | 0 ms | 2020 KB | Output is correct |
6 | Correct | 9 ms | 2020 KB | Output is correct |
7 | Correct | 9 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 | 6 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 0 ms | 2020 KB | Output is correct |
7 | Correct | 3 ms | 2020 KB | Output is correct |