# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116771 | 2019-06-13T19:46:33 Z | ioilolcom | Carnival (CEOI14_carnival) | C++14 | 11 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; #define endl "\n" typedef long long int ll; const int N=125; int P[N],an[N]; int cnt; int query(int P, int extra = 0) { if (extra <= P) { cout << P << " "; for (int i = 1; i <= P; i++) cout << i << " "; cout << endl; fflush(stdout); } else { cout << P + 1 << " "; for (int i = 1; i <= P; i++) cout << i << " "; cout << extra << endl; fflush(stdout); } int rtn; cin >> rtn; return rtn; } int main() { int n; cin>>n; for(int i=1; i<=n; i++) { P[i]=query(i,0); } for(int i=1; i<=n; i++) { int l=1; int r=i; int ans=i; while(l<r) { int mid=(l+r)/2; if(P[mid]==query(mid,i)) { r=mid; } else{ l=mid+1; } } if(l!=i) { an[i]=an[l]; } else{ an[i]=++cnt; } } cout<<0<<" "; for(int i=1; i<=n; i++) { cout<<an[i]<<" "; } cout<<endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 256 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 11 ms | 256 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 304 KB | Output is correct |
2 | Incorrect | 7 ms | 256 KB | Incorrect |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 11 ms | 384 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 256 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |