# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25919 | 2017-06-25T06:19:33 Z | kriii | Carnival (CEOI14_carnival) | C++14 | 9 ms | 1172 KB |
#include <stdio.h> #include <vector> using namespace std; vector<int> pos; int num[155], col[155], C; int main() { int N; scanf ("%d",&N); for (int i=1;i<N;i++){ printf ("%d",N-i+1); for (int j=i;j<=N;j++) printf (" %d",j); puts(""); fflush(stdout); scanf ("%d",num+i); } num[N] = 1; for (int i=1;i<=N;i++) if (num[i] != num[i+1]){ col[i] = ++C; pos.push_back(i); } for (int i=1;i<=N;i++) if (!col[i]){ while (pos[0] < i) pos.erase(pos.begin()); int l = 0, r = pos.size(), a = pos.size(); while (l + 1 < r){ int m = (l + r) / 2; printf ("%d",r-m+1); for (int i=m;i<pos.size();i++) printf (" %d",pos[i]); printf (" %d\n",i); fflush(stdout); int c; scanf ("%d",&c); if (c == r - m + 1) r = m; else l = m; } col[i] = col[pos[l]]; } printf ("0"); for (int i=1;i<=N;i++) printf (" %d",col[i]); puts(""); fflush(stdout); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1172 KB | Same person came twice to the party. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 1172 KB | Same person came twice to the party. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1172 KB | Output is correct |
2 | Incorrect | 9 ms | 1172 KB | Same person came twice to the party. |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1172 KB | Execution timed out (wall clock limit exceeded) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 1172 KB | Output is correct |
2 | Incorrect | 3 ms | 1172 KB | Same person came twice to the party. |
3 | Halted | 0 ms | 0 KB | - |