Submission #779416

#TimeUsernameProblemLanguageResultExecution timeMemory
779416groshiMađioničar (COI22_madionicar)C++17
100 / 100
1552 ms292 KiB
#include<bits/stdc++.h> #define int long long using namespace std; bool pyta(int x,int y) { cout<<"? "<<x<<" "<<y<<"\n"; int co; cin>>co; return co; } int32_t main() { //cin.tie(0); //cout.tie(0); //ios_base::sync_with_stdio(0); int n; cin>>n; int nie=3; for(int i=1;i<=n;i++) { while(i-nie/2>=1 && i+nie/2<=n && pyta(i-nie/2,i+nie/2)) nie+=2; } int parz=2; for(int i=1;i<=n;i++) { while(i-parz/2>=1 && i+parz/2-1<=n && pyta(i-parz/2,i+parz/2-1)) parz+=2; } cout<<"! "<<max(nie-2,parz-2); 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...