結果
問題 |
No.1830 Balanced Majority
|
ユーザー |
|
提出日時 | 2022-02-04 22:18:07 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 348 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 82,468 KB |
実行使用メモリ | 83,816 KB |
平均クエリ数 | 11.92 |
最終ジャッジ日時 | 2024-06-11 12:01:10 |
合計ジャッジ時間 | 3,599 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 1 |
other | WA * 12 RE * 13 |
ソースコード
def query(x): print('?',x, flush = True) ret = int(input()) return ret n = int(input()) left = 1 right = n while abs(right - left) > 1: now = (left + right) // 2 ret = query(now) if 2 * ret - now > 0: left = now elif 2 * ret - now < 0: right = now else: print('!', 1, now, flush = True)