Submission #566400

#TimeUsernameProblemLanguageResultExecution timeMemory
566400TemmieThe Big Prize (IOI17_prize)C++17
0 / 100
1 ms292 KiB
//#include "public_a/cpp/prize.h" #include "prize.h" #include <bits/stdc++.h> int find_best(int n) { int ans = 0; for (int b = 21; ~b; b--) { if (ans | (1 << b) >= n) { continue; } if (!ask(ans | (1 << b))[0]) { ans |= 1 << b; } } return ans + 1; }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:9:22: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses]
    9 |   if (ans | (1 << b) >= n) {
      |             ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...