結果

問題 No.133 カードゲーム
ユーザー nebukuro09nebukuro09
提出日時 2016-10-05 11:08:01
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 12:47:31
合計ジャッジ時間 921 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 12 ms
6,944 KB
testcase_06 AC 11 ms
6,940 KB
testcase_07 AC 13 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 11 ms
6,944 KB
testcase_11 AC 10 ms
6,940 KB
testcase_12 AC 11 ms
6,940 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 11 ms
6,944 KB
testcase_17 AC 10 ms
6,940 KB
testcase_18 AC 11 ms
6,944 KB
testcase_19 AC 11 ms
6,944 KB
testcase_20 AC 12 ms
6,940 KB
testcase_21 AC 12 ms
6,940 KB
testcase_22 AC 12 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
0