結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2020-06-11 03:21:22 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 55 ms / 5,000 ms |
コード長 | 473 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 14,080 KB |
最終ジャッジ日時 | 2024-06-24 00:26:31 |
合計ジャッジ時間 | 2,601 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
from itertools import groupby, accumulate, product, permutations, combinations from statistics import mean N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = [] for p in permutations(A,N): for q in permutations(B,N): cnt = 0 for i in range(N): if p[i]>q[i]: cnt += 1 if cnt>N//2: ans.append(1) else: ans.append(0) ans = mean(ans) print(ans)