結果

問題 No.133 カードゲーム
コンテスト
ユーザー t-rryyyoooo
提出日時 2019-09-07 01:57:39
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 505 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 408 ms
コンパイル使用メモリ 85,256 KB
実行使用メモリ 54,452 KB
最終ジャッジ日時 2026-03-11 05:46:13
合計ジャッジ時間 1,875 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 3 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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