結果

問題 No.246 質問と回答
ユーザー matsu7874matsu7874
提出日時 2015-08-29 00:22:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 24,336 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 20:06:59
合計ジャッジ時間 3,668 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
23,620 KB
testcase_01 AC 56 ms
24,012 KB
testcase_02 AC 57 ms
24,288 KB
testcase_03 AC 56 ms
23,676 KB
testcase_04 AC 56 ms
23,676 KB
testcase_05 AC 56 ms
24,000 KB
testcase_06 AC 57 ms
23,468 KB
testcase_07 AC 57 ms
24,036 KB
testcase_08 AC 56 ms
24,336 KB
testcase_09 AC 57 ms
24,000 KB
testcase_10 AC 56 ms
23,736 KB
testcase_11 AC 56 ms
24,012 KB
testcase_12 AC 57 ms
24,024 KB
testcase_13 AC 56 ms
23,680 KB
testcase_14 AC 57 ms
24,264 KB
testcase_15 AC 56 ms
23,828 KB
testcase_16 AC 55 ms
23,580 KB
testcase_17 AC 56 ms
23,552 KB
testcase_18 AC 57 ms
23,436 KB
testcase_19 AC 56 ms
23,412 KB
testcase_20 AC 56 ms
24,048 KB
testcase_21 AC 55 ms
24,048 KB
testcase_22 AC 55 ms
24,060 KB
testcase_23 AC 56 ms
24,300 KB
testcase_24 AC 56 ms
23,648 KB
testcase_25 AC 56 ms
23,664 KB
testcase_26 AC 57 ms
24,324 KB
testcase_27 AC 57 ms
24,060 KB
testcase_28 AC 56 ms
23,616 KB
testcase_29 AC 56 ms
23,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
left = 1
right = 10**9
mid = (left + right) // 2
res = 1
last_1_left = 0
while left <= right:
    mid = (left + right) // 2
    print('?', mid)
    sys.stdout.flush()
    res = int(input())
    if res == 1:
        last_1 = mid
        left = mid + 1
    else:
        right = mid - 1
print('!', last_1)
sys.stdout.flush()
0