結果

問題 No.133 カードゲーム
ユーザー rayy
提出日時 2020-06-23 04:09:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-03 19:05:25
合計ジャッジ時間 1,807 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
p = list(permutations(a))
m = len(p)
win = 0
for i in range(m):
    cnt = 0
    for j in range(n):
        if p[i][j] > b[j]:
            cnt += 1
    if cnt > n / 2:
        win += 1
print(win / m)
0