結果

問題 No.246 質問と回答
ユーザー vwxyzvwxyz
提出日時 2022-08-01 04:06:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 24,360 KB
平均クエリ数 31.00
最終ジャッジ日時 2023-09-23 20:39:52
合計ジャッジ時間 3,880 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
24,108 KB
testcase_01 AC 58 ms
23,740 KB
testcase_02 AC 59 ms
23,604 KB
testcase_03 AC 61 ms
24,108 KB
testcase_04 AC 58 ms
23,592 KB
testcase_05 AC 60 ms
23,484 KB
testcase_06 AC 61 ms
23,724 KB
testcase_07 AC 59 ms
24,348 KB
testcase_08 AC 60 ms
23,856 KB
testcase_09 AC 60 ms
23,552 KB
testcase_10 AC 58 ms
23,892 KB
testcase_11 AC 58 ms
24,360 KB
testcase_12 AC 59 ms
23,472 KB
testcase_13 AC 59 ms
23,904 KB
testcase_14 AC 63 ms
23,552 KB
testcase_15 AC 61 ms
23,460 KB
testcase_16 AC 59 ms
23,868 KB
testcase_17 AC 58 ms
23,664 KB
testcase_18 AC 58 ms
23,656 KB
testcase_19 AC 57 ms
23,540 KB
testcase_20 AC 59 ms
24,312 KB
testcase_21 AC 61 ms
23,436 KB
testcase_22 AC 58 ms
23,480 KB
testcase_23 AC 58 ms
23,628 KB
testcase_24 AC 58 ms
23,608 KB
testcase_25 AC 59 ms
23,560 KB
testcase_26 AC 61 ms
23,480 KB
testcase_27 AC 64 ms
24,300 KB
testcase_28 AC 58 ms
23,604 KB
testcase_29 AC 59 ms
23,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

def Interactive(*query):
    print(*query)
    sys.stdout.flush()
    return input()

def Bisect_Int(ok,ng,is_ok):
    while abs(ok-ng)>1:
        mid=(ok+ng)//2
        if is_ok(mid):
            ok=mid
        else:
            ng=mid
    return ok

def is_ok(x):
    return int(Interactive("?",x))

ans=Bisect_Int(1,1<<30,is_ok)
print("!",ans)
0