# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
475691 | 2021-09-23T16:58:27 Z | ZaZo_ | Carnival (CEOI14_carnival) | C++14 | 18 ms | 316 KB |
#include <bits/stdc++.h> #define HID ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define int long long #define all(v) v.begin(),v.end() const int N = 2010 , INF = 1e15; using namespace std; int n , x , all; int ans[160] = {0}; int check(vector<int>v) { cout<<v.size()<<" "; for(int i = 0 ; i < v.size() ; i++) cout<<v[i]<<" "; cout<<endl; cin >> x; return x; } int32_t main() { //HID cin >> n; cout<<n<<" "; for(int i = 1 ; i <= n ; i ++) { cout<<i<<" "; } cout<<endl; cin>>x; for(int i = 0 ; i <= n ; i++) ans[i]=x; vector<int>in; ans[1]=1; in.push_back(1); for(int i = 2 ; i <= n ; i++) { in.push_back(i); if(check(in) == in.size()) ans[i] = i; else { in.pop_back(); int l = 0 , r = in.size()-1 , cur=-1; while(l<r) { int mid = (l+r)/2; vector<int>out; for(int j = 0 ; j <= mid ; j++) out.push_back(in[j]); out.push_back(i); if(check(out) == out.size()-1) r = mid-1 , cur = mid; else l = mid+1; } if(cur!=-1) ans[i] = ans[in[cur]]; in.push_back(i); } } cout<<"0 "; for(int i = 1 ; i <= n ; i++) cout<<ans[i]<<" "; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 296 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 308 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 200 KB | Output is correct |
2 | Incorrect | 16 ms | 200 KB | Incorrect |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 316 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 18 ms | 308 KB | Incorrect |
2 | Halted | 0 ms | 0 KB | - |