제출 #566413

#제출 시각아이디문제언어결과실행 시간메모리
566413Temmie커다란 상품 (IOI17_prize)C++17
0 / 100
1 ms208 KiB
//#include "public_a/cpp/prize.h" #include "prize.h" #include <bits/stdc++.h> int find_best(int n) { if (!ask(0)[1]) { return 0; } 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; }

컴파일 시 표준 에러 (stderr) 메시지

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