結果

問題 No.246 質問と回答
ユーザー qibqib
提出日時 2023-01-16 02:10:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 230 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 87,648 KB
平均クエリ数 30.90
最終ジャッジ日時 2023-09-23 20:40:22
合計ジャッジ時間 5,806 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
87,628 KB
testcase_01 AC 119 ms
87,320 KB
testcase_02 AC 118 ms
86,880 KB
testcase_03 AC 120 ms
86,896 KB
testcase_04 AC 120 ms
87,588 KB
testcase_05 AC 118 ms
87,268 KB
testcase_06 AC 120 ms
87,240 KB
testcase_07 AC 121 ms
87,016 KB
testcase_08 AC 122 ms
87,620 KB
testcase_09 AC 118 ms
87,264 KB
testcase_10 AC 118 ms
87,076 KB
testcase_11 AC 121 ms
87,024 KB
testcase_12 AC 122 ms
87,012 KB
testcase_13 AC 118 ms
86,808 KB
testcase_14 AC 118 ms
87,352 KB
testcase_15 AC 121 ms
87,440 KB
testcase_16 AC 121 ms
87,648 KB
testcase_17 AC 121 ms
87,228 KB
testcase_18 AC 121 ms
87,108 KB
testcase_19 AC 120 ms
86,924 KB
testcase_20 AC 121 ms
87,312 KB
testcase_21 AC 121 ms
87,140 KB
testcase_22 AC 125 ms
87,124 KB
testcase_23 AC 118 ms
87,292 KB
testcase_24 AC 120 ms
87,100 KB
testcase_25 AC 119 ms
87,288 KB
testcase_26 AC 119 ms
87,296 KB
testcase_27 AC 119 ms
87,124 KB
testcase_28 AC 119 ms
87,492 KB
testcase_29 AC 118 ms
87,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

ok = 1
ng = 10 ** 9 + 1
while abs(ok - ng) > 1:
  mid = (ok + ng) // 2
  print(f"? {mid}")
  sys.stdout.flush()
  res = int(input())
  if res == 1:
    ok = mid
  else:
    ng = mid

print(f"! {ok}")
sys.stdout.flush()
0