# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99264 | 2019-03-02T03:29:23 Z | duy_tran | Carnival (CEOI14_carnival) | C++14 | 15 ms | 256 KB |
#include<bits/stdc++.h> using namespace std; const int maxn=(int)200; int n,chk[maxn]; vector<int> a; int main() { ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); cin>>n; for(int i=1;i<=n;++i) { int cnt=0; a.clear(); a.push_back(0); for(int j=1;j<=n;++j) { if(!chk[j]) { a.push_back(j); ++cnt; } } cout<<cnt<<" "; for(int j=1;j<a.size();++j)cout<<a[j]<<" "; cout<<endl; fflush(stdout); int c; cin>>c; if(c==1) { for(int j=1;j<a.size();++j)chk[a[j]]=1; cout<<0<<" "; for(int j=1;j<=n;++j)cout<<chk[j]<<" "; cout<<endl; fflush(stdout); exit(0); } else { int l=1;int r=a.size()-1; int mid; while(l<=r) { mid=(l+r)/2; int nc; cout<<mid<<" "; for(int j=1;j<=mid;++j)cout<<a[j]<<" "; cout<<endl; fflush(stdout); cin>>nc; if(nc<c-1)l=mid+1; else r=mid-1; } chk[a[l]]=c; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 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 | 3 ms | 256 KB | Output is correct |
2 | Incorrect | 15 ms | 256 KB | Incorrect |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 256 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 256 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |