結果

問題 No.133 カードゲーム
ユーザー nebukuro09nebukuro09
提出日時 2016-10-05 11:09:57
言語 Python2
(2.7.18)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 328 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 6,792 KB
実行使用メモリ 6,388 KB
最終ジャッジ日時 2023-09-07 09:26:59
合計ジャッジ時間 1,476 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,232 KB
testcase_01 AC 18 ms
6,372 KB
testcase_02 AC 13 ms
6,156 KB
testcase_03 AC 12 ms
6,172 KB
testcase_04 AC 12 ms
6,356 KB
testcase_05 AC 13 ms
6,168 KB
testcase_06 AC 14 ms
6,340 KB
testcase_07 AC 14 ms
6,388 KB
testcase_08 AC 13 ms
6,172 KB
testcase_09 AC 13 ms
6,252 KB
testcase_10 AC 13 ms
6,268 KB
testcase_11 AC 13 ms
6,344 KB
testcase_12 AC 14 ms
6,248 KB
testcase_13 AC 13 ms
6,192 KB
testcase_14 AC 13 ms
6,328 KB
testcase_15 AC 12 ms
6,384 KB
testcase_16 AC 13 ms
6,240 KB
testcase_17 AC 13 ms
6,196 KB
testcase_18 AC 14 ms
6,152 KB
testcase_19 AC 14 ms
6,364 KB
testcase_20 AC 15 ms
6,372 KB
testcase_21 AC 13 ms
6,372 KB
testcase_22 AC 13 ms
6,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
N = input()
A = map(int, raw_input().split())
B = map(int, raw_input().split())
ans = 0
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