結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2016-10-05 11:08:01 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 327 bytes |
コンパイル時間 | 116 ms |
コンパイル使用メモリ | 6,948 KB |
実行使用メモリ | 6,912 KB |
最終ジャッジ日時 | 2024-11-21 17:16:19 |
合計ジャッジ時間 | 1,376 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | AC * 13 WA * 6 |
ソースコード
from itertools import permutations N = input() A = map(int, raw_input().split()) B = map(int, raw_input().split()) ans = 1 for a in permutations(A): for b in permutations(B): if sum(c>d for c,d in zip(a,b)) > sum(d>c for c,d in zip(a,b)): ans += 1 print ans/reduce(lambda x,y:x*y, range(1, N+1), 1.0)**2