結果

問題 No.133 カードゲーム
ユーザー shinba_777
提出日時 2020-04-28 17:00:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-24 23:49:17
合計ジャッジ時間 1,935 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 1 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N = int(input())
A = input().split()
B = input().split()
cnt = 0
all = 0

for i in itertools.permutations(A):
    for j in itertools.permutations(B):
        a_win = 0
        a_lose = 0
        for k in range(N):
            if int(i[k]) > int(j[k]):
                a_win += 1
            if int(i[k]) > int(j[k]):
                a_lose += 1
        else:
            all += 1
            if a_win > a_lose:
                cnt += 1

print(cnt/all)
0