結果

問題 No.253 ロウソクの長さ
ユーザー vorg101vorg101
提出日時 2016-05-10 22:37:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 24,360 KB
平均クエリ数 25.97
最終ジャッジ日時 2023-09-23 23:51:21
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
23,560 KB
testcase_01 AC 42 ms
23,564 KB
testcase_02 AC 42 ms
24,024 KB
testcase_03 AC 38 ms
24,360 KB
testcase_04 AC 38 ms
24,048 KB
testcase_05 AC 39 ms
23,640 KB
testcase_06 AC 39 ms
23,400 KB
testcase_07 AC 39 ms
23,676 KB
testcase_08 AC 38 ms
24,312 KB
testcase_09 AC 37 ms
23,584 KB
testcase_10 AC 39 ms
23,608 KB
testcase_11 AC 38 ms
23,676 KB
testcase_12 AC 38 ms
24,312 KB
testcase_13 AC 39 ms
23,716 KB
testcase_14 AC 39 ms
23,564 KB
testcase_15 AC 39 ms
23,580 KB
testcase_16 AC 38 ms
23,868 KB
testcase_17 AC 40 ms
24,036 KB
testcase_18 AC 39 ms
24,048 KB
testcase_19 AC 37 ms
24,060 KB
testcase_20 AC 39 ms
23,664 KB
testcase_21 AC 39 ms
23,560 KB
testcase_22 AC 38 ms
23,940 KB
testcase_23 AC 39 ms
23,560 KB
testcase_24 AC 39 ms
23,344 KB
testcase_25 AC 40 ms
24,048 KB
testcase_26 AC 38 ms
23,732 KB
testcase_27 AC 39 ms
24,000 KB
testcase_28 AC 38 ms
23,820 KB
testcase_29 AC 39 ms
24,348 KB
testcase_30 AC 38 ms
23,780 KB
testcase_31 AC 38 ms
23,580 KB
testcase_32 AC 38 ms
23,776 KB
testcase_33 AC 38 ms
23,792 KB
testcase_34 AC 37 ms
24,240 KB
testcase_35 AC 38 ms
23,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

low = 10
high = pow(10, 9)
count = 0
print('?', 40)
if int(input()) == -1:
    high = 40
    low = 0
count += 1
mid = (low + high) // 2
while True:
    print('?', mid)
    r = int(input())
    if r == 0:
        print('!', mid + count)
        break
    if r == 1:
        low = mid - 1
    if r == -1:
        high = mid
        low -= 1
    mid = (low + high) // 2
    count += 1
0