結果

問題 No.133 カードゲーム
ユーザー t-rryyyoooot-rryyyoooo
提出日時 2019-09-07 01:03:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,760 KB
最終ジャッジ日時 2023-09-07 05:24:11
合計ジャッジ時間 3,375 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,552 KB
testcase_01 AC 70 ms
71,460 KB
testcase_02 AC 68 ms
71,532 KB
testcase_03 AC 69 ms
71,512 KB
testcase_04 AC 69 ms
71,380 KB
testcase_05 AC 70 ms
71,384 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 70 ms
71,512 KB
testcase_11 WA -
testcase_12 AC 69 ms
71,468 KB
testcase_13 AC 71 ms
71,636 KB
testcase_14 WA -
testcase_15 AC 71 ms
71,760 KB
testcase_16 WA -
testcase_17 AC 70 ms
71,224 KB
testcase_18 WA -
testcase_19 AC 69 ms
71,388 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 69 ms
71,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N = int(input())

a = list(map(int, input().split()))
b = list(map(int, input().split()))

per = itertools.permutations(list(range(N)), 2)

cnt = 0
count = 0
for (x, y) in per:
    if a[x]>b[y]:
        cnt += 1
    count += 1

if count ==0:
    print(0)

else:
    ans = cnt / count
    print(ans)
0