Submission #833764

#TimeUsernameProblemLanguageResultExecution timeMemory
833764caganyanmazThe Big Prize (IOI17_prize)C++17
0 / 100
1 ms304 KiB
#include <bits/stdc++.h> #include "prize.h" using namespace std; //#define DEBUGGING #ifdef DEBUGGING #include "../debug.h" #else #define debug(x...) void(42) #endif int find_best(int n) { int l = -1, r = n+1; while (r - l > 1) { int m = l+r>>1; vector<int> res = ask(m); debug(m, res[0], res[1] ); if ((res[0] + res[1] > 1)) return m; if (res[0] == 1) r = m; else l = m; } return l; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:17:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |   int m = l+r>>1;
      |           ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...