結果

問題 No.3212 SUPER Guess the Number
ユーザー 👑 loop0919
提出日時 2025-07-19 13:54:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,652 KB
実行使用メモリ 70,360 KB
平均クエリ数 21.83
最終ジャッジ日時 2025-07-25 21:00:46
合計ジャッジ時間 2,376 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

LIMIT = 10**6

prev = LIMIT + 1
print("?", prev)

ok, ng = 1, LIMIT + 1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    curr = 2 * mid - prev

    if prev < curr:
        curr += 1
    else:
        curr -= 1

    print("?", curr)

    if (int(input()) == 1) == (prev < curr):
        ok = mid
    else:
        ng = mid

    prev = curr

print("!", ok)
0