結果
| 問題 | No.133 カードゲーム | 
| コンテスト | |
| ユーザー |  umiiii | 
| 提出日時 | 2020-08-07 23:20:17 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 47 ms / 5,000 ms | 
| コード長 | 354 bytes | 
| コンパイル時間 | 225 ms | 
| コンパイル使用メモリ | 82,424 KB | 
| 実行使用メモリ | 62,324 KB | 
| 最終ジャッジ日時 | 2024-09-25 00:13:15 | 
| 合計ジャッジ時間 | 1,982 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 19 | 
ソースコード
from itertools import permutations
n=int(input())
a=list(permutations(list(map(int,input().split()))))
b=list(permutations(list(map(int,input().split()))))
ca=0
ct=0
for i in range(len(a)):
  for j in range(len(b)):
    cnta=0
    cntb=0
    for l,m in zip(a[i],b[j]):
      if l>m:cnta+=1
      else:cntb+=1
    if cnta>cntb:ca+=1
    ct+=1
print(ca/ct)
            
            
            
        