Submission #105783

#TimeUsernameProblemLanguageResultExecution timeMemory
105783RezwanArefin01The Big Prize (IOI17_prize)C++17
20 / 100
3 ms512 KiB
#include <bits/stdc++.h> #include "prize.h" using namespace std; int find_best(int n) { int lo = 0, hi = n - 1; while(lo <= hi) { int mid = lo + hi >> 1; vector<int> a = ask(mid); if(a[0] + a[1] == 0) return mid; if(a[0]) hi = mid - 1; else lo = mid + 1; } return -1; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:8:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   int mid = lo + hi >> 1; 
             ~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...