Submission #1007790

#TimeUsernameProblemLanguageResultExecution timeMemory
1007790amirhoseinfar1385Mađioničar (COI22_madionicar)C++17
0 / 100
1247 ms344 KiB
#include<bits/stdc++.h> using namespace std; bool pors(int l,int r){ if(l>r||l<=0){ return 0; } if(l==r){ return 1; } cout<<"? "<<l<<" "<<r<<endl; int x; cin>>x; return x; } int main(){ int res=1; int n; cin>>n; for(int i=2;i<=n;i++){ if(pors(i-res,i)){ res++; }else if(pors(i-res-1,i)){ res++; } } cout<<"! "<<res<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...