結果
問題 |
No.850 企業コンテスト2位
|
ユーザー |
![]() |
提出日時 | 2022-03-11 10:52:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 473 bytes |
コンパイル時間 | 331 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,768 KB |
平均クエリ数 | 197.50 |
最終ジャッジ日時 | 2024-09-15 10:51:40 |
合計ジャッジ時間 | 7,098 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 WA * 24 |
ソースコード
def ask(i, j): print("?", i+1, j+1, flush=True) return int(input())-1 def tournament(now): lose = [[] for _ in range(n)] while len(now) > 1: win = [] for i, j in zip(now[::2], now[1::2]): w = ask(i, j) lose[w].append(i ^ j ^ w) win.append(w) now = win return now[0], lose n = int(input()) top, lose = tournament(list(range(n))) ans, _ = tournament(lose[top]) print("!", ans+1, flush=True)