Submission #529605

#TimeUsernameProblemLanguageResultExecution timeMemory
529605Yazan_AlattarColors (BOI20_colors)C++14
0 / 100
1 ms200 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define F first #define S second #define pb push_back #define endl "\n" #define all(x) x.begin(), x.end() const int M = 100007; const ll inf = 2e18; const ll mod = 1e9 + 7; const double pi = acos(-1); const int dx[] = {0, -1, 0, 1}, dy[] = {1, 0, -1, 0}; ull n; bool ask(ull x){ if(x > n) return 1; cout << "? " << x << endl; bool ret; cin >> ret; return ret; } int main() { cout.flush(); cin >> n; ull l = 1, r = n + 1; while(l < r){ ull mid = (l + r) / 2; ask(1); if(ask(mid + 1)) r = mid; else l = mid + 1; } cout << "= " << l << 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...
#Verdict Execution timeMemoryGrader output
Fetching results...