結果

問題 No.133 カードゲーム
ユーザー cologne
提出日時 2022-03-04 17:40:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 5,000 ms
コード長 322 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-07-18 14:40:56
合計ジャッジ時間 1,614 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools


def main():
    N = int(input())
    *A, = map(int, input().split())
    *B, = map(int, input().split())
    t, s = 0, 0
    for Ap in itertools.permutations(A):
        w = [a > b for a, b in zip(Ap, B)]
        t += sum(w) * 2 > N
        s += 1
    print(t/s)


if __name__ == '__main__':
    main()
0