結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2019-10-02 22:31:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 379 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-03 06:02:52 |
合計ジャッジ時間 | 1,744 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertools import math N = int(input()) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] ans = 0 for a in itertools.permutations(A): for b in itertools.permutations(B): c = sum(1 if a[i] > b[i] else (-1 if a[i] < b[i] else 0) for i in range(N)) if c > 0: ans += 1 print(ans/math.factorial(N)**2)