結果

問題 No.246 質問と回答
ユーザー convexineqconvexineq
提出日時 2020-12-31 18:01:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 1,712 ms
コンパイル使用メモリ 86,580 KB
実行使用メモリ 87,792 KB
平均クエリ数 30.87
最終ジャッジ日時 2023-09-23 20:36:47
合計ジャッジ時間 7,495 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
87,024 KB
testcase_01 AC 124 ms
87,224 KB
testcase_02 AC 122 ms
87,232 KB
testcase_03 AC 122 ms
87,476 KB
testcase_04 AC 126 ms
87,656 KB
testcase_05 AC 118 ms
87,144 KB
testcase_06 AC 118 ms
87,316 KB
testcase_07 AC 120 ms
87,252 KB
testcase_08 AC 120 ms
87,268 KB
testcase_09 AC 121 ms
86,912 KB
testcase_10 AC 119 ms
86,620 KB
testcase_11 AC 119 ms
87,676 KB
testcase_12 AC 119 ms
87,516 KB
testcase_13 AC 124 ms
87,052 KB
testcase_14 AC 117 ms
87,792 KB
testcase_15 AC 125 ms
87,320 KB
testcase_16 AC 125 ms
86,952 KB
testcase_17 AC 130 ms
87,068 KB
testcase_18 AC 125 ms
87,212 KB
testcase_19 AC 128 ms
87,252 KB
testcase_20 AC 125 ms
86,868 KB
testcase_21 AC 135 ms
87,560 KB
testcase_22 AC 125 ms
87,252 KB
testcase_23 AC 125 ms
86,920 KB
testcase_24 AC 126 ms
87,248 KB
testcase_25 AC 127 ms
86,960 KB
testcase_26 AC 117 ms
87,408 KB
testcase_27 AC 119 ms
87,364 KB
testcase_28 AC 122 ms
87,044 KB
testcase_29 AC 119 ms
87,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

DEBUG = 0
ans = 10

def query(x):
    print(f"? {x}")
    sys.stdout.flush()
    if DEBUG:
        return x <= ans
    else:
        return int(input())

import sys
ok = 0
ng = 10**9+1
while ng-ok > 1:
    mid = (ng+ok)//2
    if query(mid):
        ok = mid
    else:
        ng = mid
print(f"! {ok}")
sys.stdout.flush()
0