結果

問題 No.133 カードゲーム
コンテスト
ユーザー umiiii
提出日時 2020-08-07 23:20:17
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 73 ms / 5,000 ms
+ 18µs
コード長 354 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 261 ms
コンパイル使用メモリ 96,072 KB
実行使用メモリ 83,584 KB
最終ジャッジ日時 2026-09-03 15:01:52
合計ジャッジ時間 4,213 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_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