제출 #566400

#제출 시각아이디문제언어결과실행 시간메모리
566400Temmie커다란 상품 (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;
}

컴파일 시 표준 에러 (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...