# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596440 | 2022-07-14T18:41:12 Z | Summers | Carnival (CEOI14_carnival) | C++14 | 1 ms | 208 KB |
#include<bits/stdc++.h> #pragma GCC optimize ("O3") #define endl '\n' using namespace std; long long a[10000], r[1000]; int main() { //ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long i,j,n,le,ri,mid,num=1,ans; cin>>n; a[1]=1;r[1]=1; for(i=2;i<=n;i++) { cout<<num+1; for(j=1;j<=num;j++)cout<<" "<<a[j]; cout<<" "<<i<<endl; cin>>ans; if(ans>num){num++;a[num]=i;r[i]=num;continue;} le=1; ri=num; while(le<=ri) { mid=(le+ri)/2; cout<<mid-le+2; for(j=le;j<=mid;j++)cout<<" "<<a[j]; cout<<" "<<i; cout<<endl; cin>>ans; if(ans==(mid-le+1))ri=mid-1; else le=mid+1; } r[i]=le; } cout<<0; for(i=1;i<=n;i++)cout<<" "<<r[i];cout<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 0 ms | 208 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 0 ms | 208 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 0 ms | 208 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 0 ms | 208 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1 ms | 208 KB | Time limit exceeded (wall clock) |
2 | Halted | 0 ms | 0 KB | - |