結果

問題 No.253 ロウソクの長さ
ユーザー vorg101vorg101
提出日時 2016-05-10 22:28:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 24,408 KB
平均クエリ数 27.14
最終ジャッジ日時 2023-09-23 10:36:17
合計ジャッジ時間 3,905 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
24,376 KB
testcase_01 AC 39 ms
23,452 KB
testcase_02 AC 39 ms
23,448 KB
testcase_03 AC 38 ms
23,732 KB
testcase_04 AC 38 ms
24,348 KB
testcase_05 AC 42 ms
23,776 KB
testcase_06 AC 39 ms
24,336 KB
testcase_07 AC 39 ms
24,396 KB
testcase_08 AC 40 ms
23,448 KB
testcase_09 AC 38 ms
23,552 KB
testcase_10 AC 40 ms
23,684 KB
testcase_11 AC 40 ms
24,012 KB
testcase_12 AC 39 ms
24,336 KB
testcase_13 AC 39 ms
23,412 KB
testcase_14 AC 38 ms
24,312 KB
testcase_15 AC 40 ms
23,556 KB
testcase_16 WA -
testcase_17 AC 39 ms
24,000 KB
testcase_18 AC 40 ms
24,408 KB
testcase_19 WA -
testcase_20 AC 41 ms
24,348 KB
testcase_21 AC 39 ms
23,628 KB
testcase_22 AC 39 ms
23,396 KB
testcase_23 AC 41 ms
23,640 KB
testcase_24 AC 39 ms
23,424 KB
testcase_25 AC 39 ms
23,424 KB
testcase_26 AC 39 ms
24,036 KB
testcase_27 AC 39 ms
24,000 KB
testcase_28 AC 39 ms
24,060 KB
testcase_29 AC 39 ms
24,348 KB
testcase_30 AC 39 ms
23,940 KB
testcase_31 AC 39 ms
23,628 KB
testcase_32 AC 39 ms
24,276 KB
testcase_33 AC 39 ms
23,652 KB
testcase_34 AC 38 ms
24,276 KB
testcase_35 AC 39 ms
23,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

low = 10
high = pow(10, 9)
mid = (low + high) // 2
count = 0
print('?', 40)
if int(input()) == -1:
    count += 1
    for i in range(9, 30):
        print('?', i)
        r = int(input())
        if r == 0:
            print('!', i + count)
            break
        count += 1
else:
    count += 1
    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