結果

問題 No.133 カードゲーム
ユーザー umiiiiumiiii
提出日時 2020-08-07 23:20:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 81,564 KB
実行使用メモリ 62,116 KB
最終ジャッジ日時 2023-10-25 04:47:52
合計ジャッジ時間 2,289 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,428 KB
testcase_01 AC 35 ms
53,428 KB
testcase_02 AC 35 ms
53,424 KB
testcase_03 AC 38 ms
53,424 KB
testcase_04 AC 36 ms
53,428 KB
testcase_05 AC 42 ms
59,768 KB
testcase_06 AC 43 ms
62,020 KB
testcase_07 AC 42 ms
59,768 KB
testcase_08 AC 35 ms
53,428 KB
testcase_09 AC 35 ms
53,428 KB
testcase_10 AC 42 ms
59,896 KB
testcase_11 AC 43 ms
59,768 KB
testcase_12 AC 44 ms
62,016 KB
testcase_13 AC 36 ms
53,428 KB
testcase_14 AC 36 ms
53,428 KB
testcase_15 AC 36 ms
53,428 KB
testcase_16 AC 45 ms
62,020 KB
testcase_17 AC 42 ms
59,964 KB
testcase_18 AC 44 ms
62,116 KB
testcase_19 AC 43 ms
59,896 KB
testcase_20 AC 42 ms
59,768 KB
testcase_21 AC 45 ms
62,016 KB
testcase_22 AC 44 ms
59,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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