結果

問題 No.133 カードゲーム
ユーザー 中土洋平中土洋平
提出日時 2020-10-02 11:04:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 453 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-08 03:57:57
合計ジャッジ時間 1,406 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

game = 0
awin = 0
for i in itertools.permutations(a, n):
    for j in itertools.permutations(b, n):
        a_score = 0
        for k in range(n):
            if i[k] > j[k]:
                a_score += 1
            elif i[k] < j[k]:
                a_score -= 1
        game += 1
        if a_score > 0:
            awin += 1
print(awin / game)
0