Submission #498857

#TimeUsernameProblemLanguageResultExecution timeMemory
498857devomega07Colors (BOI20_colors)C++14
0 / 100
0 ms200 KiB
#include "bits/stdc++.h" #define all(x) x.begin(),x.end() using namespace std; typedef long long l; typedef struct query{ int q, ans; } query; //flex ostream &operator<<(ostream &stream, query &obj){ cout << "? " << obj.q << endl; cin >> obj.ans; return stream; } //end of flexing.. int main() { int n; cin >> n; int num; cout << "? 1" << endl; cin >> num; int L=1, R=n; query mid; mid.q = (L+R)>>1; while(L<=R){ cout << mid; if(mid.ans){ R=mid.q; } else{ L=mid.q+1; } if(L==R){ cout << "= " << L << endl; return 0; } mid.q = (L+R)>>1; } 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...
#Verdict Execution timeMemoryGrader output
Fetching results...