結果

問題 No.133 カードゲーム
コンテスト
ユーザー Kota Kakiuchi
提出日時 2025-10-08 11:17:38
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 94 ms / 5,000 ms
+ 351µs
コード長 388 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 294 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 15,868 KB
最終ジャッジ日時 2026-07-15 15:19:02
合計ジャッジ時間 4,029 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import itertools

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

count=0
total=0
for a_perm in itertools.permutations(A):
    for b_perm in itertools.permutations(B):
        a_win=0
        for i in range(N):
            if a_perm[i] > b_perm[i]:
                a_win+=1
        if a_win>N/2:
            count+=1
        total+=1
print(count/total)
0