結果

問題 No.253 ロウソクの長さ
ユーザー qibqib
提出日時 2023-02-22 00:12:47
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 534 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 95,432 KB
平均クエリ数 16.94
最終ジャッジ日時 2023-09-29 13:03:21
合計ジャッジ時間 10,089 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 92 ms
87,176 KB
testcase_02 AC 95 ms
87,132 KB
testcase_03 AC 95 ms
87,048 KB
testcase_04 AC 96 ms
87,352 KB
testcase_05 AC 95 ms
87,488 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 92 ms
87,172 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 94 ms
87,600 KB
testcase_15 AC 96 ms
87,580 KB
testcase_16 AC 93 ms
87,300 KB
testcase_17 AC 90 ms
87,544 KB
testcase_18 RE -
testcase_19 AC 91 ms
87,428 KB
testcase_20 RE -
testcase_21 AC 94 ms
87,552 KB
testcase_22 AC 92 ms
86,996 KB
testcase_23 RE -
testcase_24 AC 94 ms
87,332 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 AC 95 ms
86,844 KB
testcase_35 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

mem = []
print("? 100")
sys.stdout.flush()
res = int(input())
mem.append((100, res))

if res == -1:
  while res != 0:
    print("? 1")
    sys.stdout.flush()
    res = int(input())
    mem.append((1, res))
elif res == 1:
  ng = 0
  ok = 10 ** 10
  while res != 0:
    mid = (ok + ng) // 2
    print(f"? {mid - len(mem)}")
    sys.stdout.flush()
    res = int(input())
    mem.append((mid - len(mem), res))

    if res < 0:
      ok = mid
    else:
      ng = mid

print(f"! {mem[-1][0] + len(mem) - 1}")
sys.stdout.flush()
0