結果

問題 No.133 カードゲーム
ユーザー daku9640
提出日時 2017-02-22 15:59:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2024-06-25 03:48:38
合計ジャッジ時間 1,928 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import permutations

n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

cnt = win = 0

for i in permutations(a, n):
    cnt += 1
    w = 0
    for x, y in zip(i, b):
        if x > y: w += 1
        elif x < y: w -= 1
    if w > 0: win += 1

print(win / cnt)
0