結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2024-10-04 20:19:42 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 464 ms / 5,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 44,588 KB |
最終ジャッジ日時 | 2024-10-04 20:19:57 |
合計ジャッジ時間 | 11,540 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertools import numpy as np N = int(input()) cards_a = list(map(int, input().split())) cards_b = list(map(int, input().split())) total = 0 win_a = 0 for pattern_a in itertools.permutations(cards_a): for pattern_b in itertools.permutations(cards_b): pattern_a = np.array(list(pattern_a)) pattern_b = np.array(list(pattern_b)) fight = np.sum(pattern_a > pattern_b) if fight > N - fight: win_a += 1 total += 1 print(win_a / total)