Submission #938402

#TimeUsernameProblemLanguageResultExecution timeMemory
938402PacybwoahMađioničar (COI22_madionicar)C++17
0 / 100
734 ms344 KiB
#include<iostream> #include<vector> #include<algorithm> using namespace std; bool ask(int l,int r){ cout<<"? "<<l<<" "<<r<<endl; bool flag; cin>>flag; return flag; } int main(){ int n; cin>>n; int ans=0; for(int i=2;i<=n+1;i++){ int l,r; if((i-ans+1)%2==0) l=(i-ans+1)/2-1; else l=(i-ans+1)/2; r=i-l; while(l>=1&&r<=n&&ask(l,r)){ l--; r++; } l++; r--; ans=max(ans,r-l+1); } cout<<"! "<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...