結果

問題 No.133 カードゲーム
ユーザー あかりきあかりき
提出日時 2021-02-23 20:31:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 370 bytes
コンパイル時間 693 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 62,212 KB
最終ジャッジ日時 2023-10-23 21:24:30
合計ジャッジ時間 2,234 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,576 KB
testcase_01 AC 38 ms
53,576 KB
testcase_02 AC 39 ms
53,572 KB
testcase_03 AC 39 ms
53,572 KB
testcase_04 AC 39 ms
53,576 KB
testcase_05 AC 45 ms
60,016 KB
testcase_06 AC 46 ms
62,212 KB
testcase_07 AC 45 ms
60,024 KB
testcase_08 AC 38 ms
53,576 KB
testcase_09 AC 38 ms
53,576 KB
testcase_10 AC 44 ms
60,024 KB
testcase_11 AC 44 ms
60,024 KB
testcase_12 AC 46 ms
62,212 KB
testcase_13 AC 37 ms
53,576 KB
testcase_14 AC 38 ms
53,576 KB
testcase_15 AC 38 ms
53,576 KB
testcase_16 AC 46 ms
62,212 KB
testcase_17 AC 43 ms
60,016 KB
testcase_18 AC 46 ms
62,212 KB
testcase_19 AC 44 ms
60,016 KB
testcase_20 AC 45 ms
60,016 KB
testcase_21 AC 47 ms
60,164 KB
testcase_22 AC 47 ms
60,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
l=[i for i in range(n)]
l2=list(itertools.permutations(l))
ans=0
for i in range(len(l2)):
  for j in range(len(l2)):
    ct=0
    for k in range(n):
      if a[l2[i][k]]>b[l2[j][k]]:
        ct+=1
      else:
        ct-=1
    if ct>0:
      ans+=1
print(ans/(len(l2)**2))
0