結果
| 問題 | No.133 カードゲーム | 
| コンテスト | |
| ユーザー |  c-yan | 
| 提出日時 | 2021-02-18 01:12:02 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 31 ms / 5,000 ms | 
| コード長 | 377 bytes | 
| コンパイル時間 | 546 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-09-14 09:41:54 | 
| 合計ジャッジ時間 | 2,140 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 19 | 
ソースコード
from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
wins = 0
games = 0
for a in permutations(A):
    for b in permutations(B):
        games += 1
        t = 0
        for i in range(N):
            if a[i] > b[i]:
                t += 1
        if t > N // 2:
            wins += 1
print(wins / games)
            
            
            
        