結果

問題 No.246 質問と回答
ユーザー convexineq
提出日時 2025-02-10 19:49:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 81,924 KB
実行使用メモリ 71,464 KB
平均クエリ数 30.00
最終ジャッジ日時 2025-02-10 19:49:45
合計ジャッジ時間 4,698 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

def query_ask(y):
    print(f"? {y}", flush=True)
    if DEBUG:
        return  y <= X
    else:
        return int(input())

def query_ans(x):
    print(f"! {x}", flush=True)
    

DEBUG = 0
if DEBUG:
    print("DEBUG MODE!")
    X = 10

from bisect import bisect_left

def reverse_result(y):
    return ~query_ask(y)

ans = bisect_left(range(10**9+1),1,key=reverse_result)
query_ans(ans)

0