結果

問題 No.1279 Array Battle
ユーザー 👑 tamatotamato
提出日時 2020-11-06 21:22:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 402 ms
コンパイル使用メモリ 87,504 KB
実行使用メモリ 77,136 KB
最終ジャッジ日時 2023-09-29 18:01:42
合計ジャッジ時間 3,025 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,544 KB
testcase_01 AC 69 ms
71,940 KB
testcase_02 AC 70 ms
71,984 KB
testcase_03 AC 73 ms
71,860 KB
testcase_04 AC 68 ms
71,640 KB
testcase_05 AC 69 ms
71,900 KB
testcase_06 AC 69 ms
71,552 KB
testcase_07 AC 70 ms
71,920 KB
testcase_08 AC 69 ms
71,896 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 107 ms
76,804 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from itertools import permutations
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    ma = 0
    cnt = 0
    for P in permutations(A):
        tmp = 0
        for i, a in enumerate(P):
            if a > B[i]:
                tmp += a - B[i]
        if tmp == ma:
            cnt += 1
        elif tmp > cnt:
            ma = tmp
            cnt = 1
    print(cnt)


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