結果

問題 No.246 質問と回答
ユーザー ynyn
提出日時 2015-08-01 14:36:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 24,300 KB
平均クエリ数 32.33
最終ジャッジ日時 2023-09-23 20:05:06
合計ジャッジ時間 4,156 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
23,420 KB
testcase_01 AC 53 ms
23,616 KB
testcase_02 AC 52 ms
23,832 KB
testcase_03 AC 53 ms
24,096 KB
testcase_04 AC 52 ms
23,624 KB
testcase_05 AC 54 ms
23,504 KB
testcase_06 AC 56 ms
23,536 KB
testcase_07 AC 54 ms
24,060 KB
testcase_08 AC 55 ms
24,012 KB
testcase_09 AC 54 ms
23,988 KB
testcase_10 AC 54 ms
24,300 KB
testcase_11 AC 53 ms
23,560 KB
testcase_12 AC 53 ms
23,532 KB
testcase_13 AC 53 ms
23,668 KB
testcase_14 AC 54 ms
23,820 KB
testcase_15 AC 56 ms
23,424 KB
testcase_16 AC 54 ms
24,000 KB
testcase_17 AC 56 ms
23,988 KB
testcase_18 AC 55 ms
24,036 KB
testcase_19 AC 53 ms
23,652 KB
testcase_20 AC 53 ms
23,568 KB
testcase_21 AC 53 ms
23,488 KB
testcase_22 AC 52 ms
23,576 KB
testcase_23 AC 54 ms
23,496 KB
testcase_24 AC 55 ms
23,448 KB
testcase_25 AC 52 ms
23,736 KB
testcase_26 AC 54 ms
23,460 KB
testcase_27 AC 54 ms
24,012 KB
testcase_28 AC 54 ms
23,584 KB
testcase_29 AC 52 ms
24,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

ans = 0
low = 1
high = int(1e9 + 1)
mid = (low + high) // 2 + 1
beforemid = 0

while True :
	mid = (low + high) // 2
	print("?", mid)
	sys.stdout.flush()
	res = int(input())

	if res == 1 :
		low = mid
	else :
		high = mid

	if beforemid == mid :
		break

	beforemid = mid

if res == 0 :
	mid = mid - 1

print("!", int(mid))
sys.stdout.flush()
0