結果

問題 No.253 ロウソクの長さ
ユーザー qibqib
提出日時 2023-02-22 01:25:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 867 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 87,752 KB
平均クエリ数 33.92
最終ジャッジ日時 2023-09-29 13:43:32
合計ジャッジ時間 5,111 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
87,284 KB
testcase_01 AC 77 ms
86,960 KB
testcase_02 AC 79 ms
87,520 KB
testcase_03 AC 81 ms
87,476 KB
testcase_04 AC 79 ms
87,024 KB
testcase_05 AC 77 ms
87,448 KB
testcase_06 AC 77 ms
87,016 KB
testcase_07 AC 77 ms
87,100 KB
testcase_08 AC 76 ms
87,136 KB
testcase_09 AC 75 ms
87,280 KB
testcase_10 AC 76 ms
87,004 KB
testcase_11 AC 75 ms
87,288 KB
testcase_12 AC 77 ms
87,288 KB
testcase_13 AC 81 ms
87,752 KB
testcase_14 AC 79 ms
87,556 KB
testcase_15 AC 81 ms
86,908 KB
testcase_16 AC 77 ms
87,464 KB
testcase_17 AC 74 ms
87,420 KB
testcase_18 AC 75 ms
87,264 KB
testcase_19 AC 75 ms
87,332 KB
testcase_20 AC 77 ms
87,332 KB
testcase_21 AC 78 ms
87,264 KB
testcase_22 AC 77 ms
87,612 KB
testcase_23 AC 76 ms
86,828 KB
testcase_24 AC 78 ms
87,020 KB
testcase_25 AC 76 ms
87,292 KB
testcase_26 AC 78 ms
87,292 KB
testcase_27 AC 77 ms
87,640 KB
testcase_28 AC 75 ms
87,228 KB
testcase_29 AC 77 ms
87,024 KB
testcase_30 AC 77 ms
86,884 KB
testcase_31 AC 78 ms
86,776 KB
testcase_32 AC 76 ms
87,500 KB
testcase_33 AC 76 ms
87,200 KB
testcase_34 AC 75 ms
87,036 KB
testcase_35 AC 77 ms
87,560 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 100
  ok = 10 ** 9 + 1
  while ok - ng > 1:
    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
    if mem[-1][1] == 0:
      break

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