結果

問題 No.253 ロウソクの長さ
ユーザー vorg101vorg101
提出日時 2016-05-10 21:29:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,656 KB
実行使用メモリ 24,564 KB
平均クエリ数 29.64
最終ジャッジ日時 2023-09-23 10:35:49
合計ジャッジ時間 4,231 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
23,304 KB
testcase_01 AC 41 ms
23,736 KB
testcase_02 AC 40 ms
23,476 KB
testcase_03 AC 39 ms
24,336 KB
testcase_04 WA -
testcase_05 AC 38 ms
23,676 KB
testcase_06 AC 39 ms
24,036 KB
testcase_07 AC 41 ms
23,616 KB
testcase_08 AC 39 ms
24,396 KB
testcase_09 WA -
testcase_10 AC 38 ms
24,324 KB
testcase_11 AC 39 ms
23,784 KB
testcase_12 AC 41 ms
23,832 KB
testcase_13 AC 39 ms
23,592 KB
testcase_14 WA -
testcase_15 AC 42 ms
24,336 KB
testcase_16 AC 39 ms
23,404 KB
testcase_17 AC 40 ms
23,580 KB
testcase_18 AC 39 ms
23,804 KB
testcase_19 WA -
testcase_20 AC 40 ms
24,336 KB
testcase_21 AC 39 ms
24,384 KB
testcase_22 RE -
testcase_23 AC 38 ms
24,036 KB
testcase_24 AC 38 ms
23,712 KB
testcase_25 AC 39 ms
23,600 KB
testcase_26 AC 39 ms
24,336 KB
testcase_27 AC 39 ms
23,484 KB
testcase_28 AC 39 ms
24,348 KB
testcase_29 AC 38 ms
24,396 KB
testcase_30 AC 39 ms
23,572 KB
testcase_31 AC 39 ms
23,496 KB
testcase_32 AC 39 ms
23,436 KB
testcase_33 AC 39 ms
24,264 KB
testcase_34 WA -
testcase_35 AC 38 ms
24,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

low = 10
high = pow(10, 9)
mid = (low + high) // 2
count = 0
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