結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2020-06-23 04:05:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-03 19:05:32 |
合計ジャッジ時間 | 1,580 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
from itertools import permutationsn = int(input())a = list(map(int, input().split()))b = list(map(int, input().split()))Pa = list(permutations(a))Pb = list(permutations(b))m = len(Pa)win = 0for i in range(m):for j in range(m):cnt = 0for k in range(n):if Pa[i][k] > Pb[j][k]:cnt += 1if cnt > n / 2:win += 1print(win / m ** 2)