結果

問題 No.253 ロウソクの長さ
ユーザー qibqib
提出日時 2023-02-14 00:06:45
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 533 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 90,112 KB
平均クエリ数 31.72
最終ジャッジ日時 2023-09-24 03:09:15
合計ジャッジ時間 8,920 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
87,152 KB
testcase_01 AC 101 ms
87,264 KB
testcase_02 AC 100 ms
87,776 KB
testcase_03 AC 95 ms
87,136 KB
testcase_04 AC 97 ms
87,376 KB
testcase_05 AC 97 ms
87,240 KB
testcase_06 AC 97 ms
86,972 KB
testcase_07 AC 97 ms
87,308 KB
testcase_08 AC 97 ms
87,524 KB
testcase_09 AC 96 ms
86,964 KB
testcase_10 AC 98 ms
87,092 KB
testcase_11 AC 99 ms
86,900 KB
testcase_12 AC 95 ms
86,936 KB
testcase_13 AC 96 ms
87,576 KB
testcase_14 AC 96 ms
87,244 KB
testcase_15 AC 98 ms
87,088 KB
testcase_16 AC 94 ms
87,536 KB
testcase_17 AC 94 ms
86,996 KB
testcase_18 AC 96 ms
87,104 KB
testcase_19 AC 95 ms
87,204 KB
testcase_20 AC 94 ms
87,816 KB
testcase_21 AC 95 ms
87,076 KB
testcase_22 AC 93 ms
87,632 KB
testcase_23 AC 93 ms
87,600 KB
testcase_24 AC 94 ms
87,284 KB
testcase_25 AC 93 ms
86,944 KB
testcase_26 AC 93 ms
87,484 KB
testcase_27 AC 94 ms
87,432 KB
testcase_28 AC 95 ms
87,076 KB
testcase_29 AC 95 ms
87,044 KB
testcase_30 AC 94 ms
87,348 KB
testcase_31 AC 94 ms
87,516 KB
testcase_32 AC 94 ms
87,272 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

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 ** 9
  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