Submission #959790

#TimeUsernameProblemLanguageResultExecution timeMemory
959790Darren0724Mađioničar (COI22_madionicar)C++17
0 / 100
0 ms436 KiB
#include <bits/stdc++.h> using namespace std; #define LCBorz ios_base::sync_with_stdio(false); cin.tie(0); #define all(x) x.begin(), x.end() //#define endl '\n' const int N=200005; int ask(int a,int b){ cout<<"? "<<a<<' '<<b<<endl; int p;cin>>p; return p; } int32_t main() { //LCBorz; int n;cin>>n; int ans=1; for(int t:{0,1}){ int len=t; for(int i=1;i<=n;i++){ while(i+len+1<=n&&ask(i,i+len+1)){ len+=2; i--; } ans=max(ans,len); } } cout<<"! "<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...