結果
問題 |
No.850 企業コンテスト2位
|
ユーザー |
![]() |
提出日時 | 2022-03-11 10:43:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 27,864 KB |
平均クエリ数 | 197.50 |
最終ジャッジ日時 | 2024-09-15 10:44:17 |
合計ジャッジ時間 | 7,578 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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): while len(now) > 1: win = [] for i, j in zip(now[::2], now[1::2]): win.append(ask(i, j)) opp[i].append(j) opp[j].append(i) now = win return now[0] n = int(input()) opp = [[] for _ in range(n)] top = tournament(list(range(n))) ans = tournament(opp[top]) print("!", ans+1, flush=True)