結果

問題 No.133 カードゲーム
ユーザー t-rryyyoooot-rryyyoooo
提出日時 2019-09-07 01:57:39
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 71,824 KB
最終ジャッジ日時 2023-09-07 06:49:12
合計ジャッジ時間 3,259 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,580 KB
testcase_01 AC 77 ms
71,504 KB
testcase_02 AC 77 ms
71,412 KB
testcase_03 AC 77 ms
71,232 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 77 ms
71,508 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 76 ms
71,472 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N = int(input())

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

per1 = itertools.permutations(list(range(N)), N)
per2 = itertools.permutations(list(range(N)), N)
cnt = 0
count = 0
c = 0

for xx in per2:
    for x in xx:
        for yy in per1:
            cnt = 0
            for y in yy:
                if a[x]>b[y]:
                    cnt += 1
            c += 1

            if cnt > N/2:
                count += 1


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