結果

問題 No.133 カードゲーム
コンテスト
ユーザー umiiii
提出日時 2020-08-07 23:20:17
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 354 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 134 ms
コンパイル使用メモリ 85,328 KB
実行使用メモリ 61,056 KB
最終ジャッジ日時 2026-04-12 03:59:48
合計ジャッジ時間 1,800 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0