結果

問題 No.246 質問と回答
ユーザー matsu7874matsu7874
提出日時 2015-08-29 00:20:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 10,476 KB
実行使用メモリ 24,564 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 07:58:15
合計ジャッジ時間 3,619 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 56 ms
24,324 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 55 ms
24,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 55 ms
24,096 KB
testcase_09 WA -
testcase_10 AC 56 ms
23,912 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 55 ms
23,820 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 55 ms
24,384 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 56 ms
23,464 KB
testcase_22 AC 56 ms
23,568 KB
testcase_23 AC 56 ms
23,820 KB
testcase_24 AC 56 ms
23,632 KB
testcase_25 WA -
testcase_26 AC 54 ms
24,264 KB
testcase_27 AC 55 ms
23,588 KB
testcase_28 WA -
testcase_29 AC 55 ms
23,480 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_left = left
        left = mid + 1
    else:
        right = mid - 1
print('!', last_1_left)
sys.stdout.flush()
0