結果

問題 No.253 ロウソクの長さ
ユーザー mkawa2mkawa2
提出日時 2020-01-30 22:54:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 24,468 KB
平均クエリ数 31.06
最終ジャッジ日時 2023-09-24 02:25:00
合計ジャッジ時間 3,573 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
23,996 KB
testcase_01 AC 40 ms
24,416 KB
testcase_02 AC 40 ms
23,772 KB
testcase_03 AC 39 ms
24,056 KB
testcase_04 AC 39 ms
24,092 KB
testcase_05 AC 39 ms
23,836 KB
testcase_06 AC 39 ms
23,732 KB
testcase_07 AC 40 ms
23,944 KB
testcase_08 AC 40 ms
24,396 KB
testcase_09 AC 38 ms
24,100 KB
testcase_10 AC 39 ms
24,256 KB
testcase_11 AC 40 ms
24,064 KB
testcase_12 AC 39 ms
24,068 KB
testcase_13 AC 39 ms
23,848 KB
testcase_14 AC 38 ms
23,896 KB
testcase_15 AC 41 ms
23,988 KB
testcase_16 AC 38 ms
23,692 KB
testcase_17 AC 39 ms
24,056 KB
testcase_18 AC 39 ms
24,468 KB
testcase_19 AC 39 ms
23,876 KB
testcase_20 AC 39 ms
23,936 KB
testcase_21 AC 41 ms
24,116 KB
testcase_22 AC 39 ms
23,884 KB
testcase_23 AC 40 ms
24,104 KB
testcase_24 AC 40 ms
24,304 KB
testcase_25 AC 39 ms
24,048 KB
testcase_26 AC 39 ms
23,712 KB
testcase_27 AC 39 ms
24,272 KB
testcase_28 AC 40 ms
23,884 KB
testcase_29 AC 39 ms
23,892 KB
testcase_30 AC 39 ms
24,044 KB
testcase_31 AC 39 ms
24,396 KB
testcase_32 AC 39 ms
24,176 KB
testcase_33 AC 40 ms
24,108 KB
testcase_34 AC 39 ms
23,912 KB
testcase_35 AC 39 ms
24,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    def ask(m):
        print("?",m)
        ret=int(input())
        if ret==0:
            print("!",m+cnt)
            exit()
        return ret

    cnt=0
    if ask(100)==-1:
        cnt+=1
        while 1:
            ask(8)
            cnt+=1

    l,r=95,10**9+1
    cnt=1
    while l+1<r:
        m=(l+r)//2
        res=ask(m)
        if res==1:l=m
        if res==-1:r=m
        l-=1
        r-=1
        cnt+=1

main()
0