# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
995994 | 2024-06-10T06:48:36 Z | vjudge1 | Carnival (CEOI14_carnival) | C++14 | 5 ms | 596 KB |
#include<bits/stdc++.h> using namespace std; signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> first; int input; first.push_back(1); for(int i=2;i<=n;i++){ cout << first.size()+1 << ' '; for(int j=0;j<first.size();j++){ cout << first[j] << ' '; } cout << i << endl; cin >> input; if(input==first.size()+1){ first.push_back(i); } } int ans[n+1]; memset(ans,0,sizeof(ans)); for(int i=0;i<first.size();i++){ ans[first[i]]=i+1; } for(int i=1;i<=n;i++){ if(ans[i]!=0){ continue; } int low=1,high=first.size(); low--; high++; while(high-low>1){ int mid=(high-low)/2+low; cout << mid+1 << ' '; for(int j=0;j<mid;j++){ cout << first[j] << ' '; } cout << i << endl; cin >> input; if(input==mid+1){ high=mid; } else{ low=mid; } } ans[i]=high; } cout << "0"; for(int i=1;i<=n;i++){ cout << ' ' << ans[i]; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 344 KB | Integer 12 violates the range [1, 11] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 344 KB | Integer 6 violates the range [1, 5] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 344 KB | Integer 2 violates the range [1, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 344 KB | Integer 5 violates the range [1, 4] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 596 KB | Integer 3 violates the range [1, 2] |
2 | Halted | 0 ms | 0 KB | - |