結果

問題 No.133 カードゲーム
ユーザー daku9640daku9640
提出日時 2017-02-22 15:59:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 71,700 KB
最終ジャッジ日時 2023-09-07 09:31:03
合計ジャッジ時間 3,125 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,408 KB
testcase_01 AC 72 ms
71,224 KB
testcase_02 AC 74 ms
71,248 KB
testcase_03 AC 74 ms
71,368 KB
testcase_04 AC 73 ms
71,452 KB
testcase_05 AC 72 ms
71,460 KB
testcase_06 AC 72 ms
71,480 KB
testcase_07 AC 72 ms
71,488 KB
testcase_08 AC 71 ms
71,424 KB
testcase_09 AC 69 ms
71,496 KB
testcase_10 AC 73 ms
71,164 KB
testcase_11 AC 71 ms
71,668 KB
testcase_12 AC 74 ms
71,452 KB
testcase_13 AC 73 ms
71,460 KB
testcase_14 AC 72 ms
71,320 KB
testcase_15 AC 75 ms
71,676 KB
testcase_16 AC 73 ms
71,516 KB
testcase_17 AC 71 ms
71,516 KB
testcase_18 AC 75 ms
71,440 KB
testcase_19 AC 73 ms
71,572 KB
testcase_20 AC 73 ms
71,268 KB
testcase_21 AC 73 ms
71,700 KB
testcase_22 AC 74 ms
71,344 KB
権限があれば一括ダウンロードができます

ソースコード

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