# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168817 | 2019-12-16T15:05:35 Z | songc | Carnival (CEOI14_carnival) | C++14 | 32 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; typedef long long LL; int N, num=1; int P[220], A[220]; int main(){ scanf("%d", &N); for (int i=1; i<N; i++){ int L=i+1, H=N; while (L<=H){ int mid = (L+H)/2, ret1, ret2; printf("%d", mid-i+1); for (int j=i; j<=mid; j++) printf(" %d", j); cout<<endl; scanf("%d", &ret1); printf("%d", mid-i); for (int j=i+1; j<=mid; j++) printf(" %d", j); cout<<endl; scanf("%d", &ret2); if (ret1 == ret2) P[i] = mid, H = mid-1; else L = mid+1; } } printf("0"); for (int i=1; i<=N; i++){ if (A[i] == 0) A[i] = num++; A[P[i]] = A[i]; printf(" %d", A[i]); } printf("\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 376 KB | Output is correct |
2 | Correct | 22 ms | 376 KB | Output is correct |
3 | Correct | 27 ms | 376 KB | Output is correct |
4 | Correct | 18 ms | 248 KB | Output is correct |
5 | Correct | 17 ms | 248 KB | Output is correct |
6 | Correct | 18 ms | 376 KB | Output is correct |
7 | Correct | 25 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 248 KB | Output is correct |
2 | Correct | 19 ms | 248 KB | Output is correct |
3 | Correct | 17 ms | 248 KB | Output is correct |
4 | Correct | 28 ms | 248 KB | Output is correct |
5 | Correct | 21 ms | 376 KB | Output is correct |
6 | Correct | 12 ms | 248 KB | Output is correct |
7 | Correct | 12 ms | 248 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 248 KB | Output is correct |
2 | Correct | 21 ms | 376 KB | Output is correct |
3 | Correct | 27 ms | 376 KB | Output is correct |
4 | Correct | 25 ms | 248 KB | Output is correct |
5 | Correct | 23 ms | 252 KB | Output is correct |
6 | Correct | 13 ms | 252 KB | Output is correct |
7 | Correct | 19 ms | 248 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 13 ms | 376 KB | Output is correct |
2 | Correct | 23 ms | 248 KB | Output is correct |
3 | Correct | 31 ms | 248 KB | Output is correct |
4 | Correct | 32 ms | 376 KB | Output is correct |
5 | Correct | 27 ms | 248 KB | Output is correct |
6 | Correct | 26 ms | 376 KB | Output is correct |
7 | Correct | 26 ms | 376 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 248 KB | Output is correct |
2 | Correct | 24 ms | 376 KB | Output is correct |
3 | Correct | 27 ms | 248 KB | Output is correct |
4 | Correct | 22 ms | 248 KB | Output is correct |
5 | Correct | 16 ms | 376 KB | Output is correct |
6 | Correct | 29 ms | 376 KB | Output is correct |
7 | Correct | 31 ms | 248 KB | Output is correct |