# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1085717 | 2024-09-08T15:34:58 Z | vjudge1 | Carnival (CEOI14_carnival) | C++17 | 82 ms | 592 KB |
#include <bits/stdc++.h> using namespace std; vector<int>v; bool check2(int l,int r,int k) { cout<<r-l+2<<" "; for(int i=l;i<=r;i++) { cout<<v[i]<<" "; } cout<<k<<endl; int a; cin>>a; if(a==r-l+2) { return true; } return false; } bool check(int k) { cout<<v.size()+1<<" "; for(int i=0;i<v.size();i++) { cout<<v[i]<<" "; } cout<<k<<endl; int a; cin>>a; if(a==v.size()+1) { return true; } return false; } int main() { int n,cnt=1; cin>>n; vector<int>res(n+1); res[1]=cnt++; v.push_back(1); for(int i=2;i<=n;i++) { if(check(i)) { v.push_back(i); res[i]=cnt++; } else { int l=0,r=v.size()-1; while(l<r) { int m=l+r/2; if(check2(l,m,i)) { l=m+1; } else { r=m; } } res[i]=res[v[l]]; } } cout<<"0 "; for(int i=1;i<=n;i++) { cout<<res[i]<<" "; } cout<<endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 82 ms | 412 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Runtime error | 58 ms | 344 KB | Execution killed with signal 13 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 60 ms | 592 KB | Execution killed with signal 13 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 344 KB | Output is correct |
2 | Runtime error | 51 ms | 416 KB | Execution killed with signal 13 |
3 | Halted | 0 ms | 0 KB | - |