結果

問題 No.246 質問と回答
ユーザー zombietanzombietan
提出日時 2016-06-02 09:12:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 24,312 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 20:16:03
合計ジャッジ時間 3,837 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
23,512 KB
testcase_01 AC 55 ms
24,288 KB
testcase_02 AC 55 ms
24,168 KB
testcase_03 AC 55 ms
23,368 KB
testcase_04 AC 56 ms
23,532 KB
testcase_05 AC 57 ms
23,928 KB
testcase_06 AC 56 ms
24,084 KB
testcase_07 AC 56 ms
23,636 KB
testcase_08 AC 56 ms
23,540 KB
testcase_09 AC 56 ms
23,900 KB
testcase_10 AC 54 ms
23,456 KB
testcase_11 AC 54 ms
23,356 KB
testcase_12 AC 55 ms
23,580 KB
testcase_13 AC 56 ms
23,708 KB
testcase_14 AC 57 ms
23,596 KB
testcase_15 AC 56 ms
23,652 KB
testcase_16 AC 56 ms
24,276 KB
testcase_17 AC 57 ms
23,928 KB
testcase_18 AC 57 ms
24,144 KB
testcase_19 AC 55 ms
23,736 KB
testcase_20 AC 56 ms
24,312 KB
testcase_21 AC 55 ms
23,460 KB
testcase_22 AC 55 ms
23,660 KB
testcase_23 AC 54 ms
24,180 KB
testcase_24 AC 57 ms
23,664 KB
testcase_25 AC 57 ms
23,904 KB
testcase_26 AC 56 ms
23,612 KB
testcase_27 AC 56 ms
23,608 KB
testcase_28 AC 57 ms
23,944 KB
testcase_29 AC 57 ms
23,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math

low = 1
high = 10**9 + 1
ans = 1

while low <= high:
    center = math.floor((low + high)/2)
    print('?', center)
    sys.stdout.flush()
    r = input()
    if r == '1':
        ans = center
        low = center + 1
    else:
        high = center - 1

print('!', ans)
sys.stdout.flush()
0