結果

問題 No.253 ロウソクの長さ
ユーザー qibqib
提出日時 2023-02-22 00:30:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 87,684 KB
平均クエリ数 33.92
最終ジャッジ日時 2023-09-29 13:13:57
合計ジャッジ時間 6,471 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
87,568 KB
testcase_01 AC 102 ms
87,260 KB
testcase_02 AC 103 ms
87,000 KB
testcase_03 AC 97 ms
86,812 KB
testcase_04 AC 99 ms
87,580 KB
testcase_05 AC 102 ms
87,424 KB
testcase_06 AC 101 ms
87,304 KB
testcase_07 AC 101 ms
87,324 KB
testcase_08 AC 100 ms
87,244 KB
testcase_09 AC 99 ms
87,352 KB
testcase_10 AC 101 ms
87,100 KB
testcase_11 AC 100 ms
87,084 KB
testcase_12 AC 99 ms
87,236 KB
testcase_13 AC 102 ms
87,576 KB
testcase_14 AC 100 ms
87,408 KB
testcase_15 AC 102 ms
86,892 KB
testcase_16 AC 102 ms
87,500 KB
testcase_17 AC 99 ms
87,400 KB
testcase_18 AC 100 ms
87,424 KB
testcase_19 AC 99 ms
87,332 KB
testcase_20 AC 100 ms
86,740 KB
testcase_21 AC 99 ms
87,464 KB
testcase_22 AC 101 ms
87,152 KB
testcase_23 AC 99 ms
87,684 KB
testcase_24 AC 103 ms
86,916 KB
testcase_25 AC 100 ms
87,308 KB
testcase_26 AC 100 ms
87,552 KB
testcase_27 AC 100 ms
87,532 KB
testcase_28 AC 99 ms
87,424 KB
testcase_29 AC 101 ms
87,164 KB
testcase_30 AC 99 ms
87,096 KB
testcase_31 AC 101 ms
87,236 KB
testcase_32 AC 98 ms
87,376 KB
testcase_33 WA -
testcase_34 AC 97 ms
87,316 KB
testcase_35 AC 98 ms
87,168 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
  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