結果

問題 No.133 カードゲーム
ユーザー tokuD_kyoprotokuD_kyopro
提出日時 2021-11-30 11:48:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 5,000 ms
コード長 760 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 81,320 KB
最終ジャッジ日時 2023-09-16 04:13:41
合計ジャッジ時間 5,501 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
80,140 KB
testcase_01 AC 158 ms
80,212 KB
testcase_02 AC 159 ms
80,180 KB
testcase_03 AC 158 ms
80,240 KB
testcase_04 AC 156 ms
80,144 KB
testcase_05 AC 162 ms
81,168 KB
testcase_06 AC 164 ms
81,056 KB
testcase_07 AC 161 ms
81,152 KB
testcase_08 AC 159 ms
80,200 KB
testcase_09 AC 158 ms
80,364 KB
testcase_10 AC 161 ms
80,996 KB
testcase_11 AC 164 ms
81,320 KB
testcase_12 AC 165 ms
81,164 KB
testcase_13 AC 159 ms
80,200 KB
testcase_14 AC 160 ms
80,188 KB
testcase_15 AC 161 ms
80,272 KB
testcase_16 AC 167 ms
81,100 KB
testcase_17 AC 164 ms
81,124 KB
testcase_18 AC 163 ms
81,228 KB
testcase_19 AC 169 ms
81,092 KB
testcase_20 AC 160 ms
81,036 KB
testcase_21 AC 161 ms
81,132 KB
testcase_22 AC 164 ms
81,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#from __future__ import annotations
from typing import List,Union
import sys
input = sys.stdin.readline
# from collections import defaultdict,deque
from itertools import permutations,combinations
# from bisect import bisect_left,bisect_right
# import heapq
# sys.setrecursionlimit(10**5)

def main():
    N = int(input())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    total = 0
    wins = 0

    for a in permutations(A):
        for b in permutations(B):
            total += 1
            win = 0
            lose = 0
            for x,y in zip(a,b):
                if x > y: win += 1
                if x < y: lose += 1
            if win > lose: wins += 1

    print(wins/total)


if __name__ == '__main__':
    main()
0