結果

問題 No.1279 Array Battle
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-11-06 22:22:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 78,076 KB
最終ジャッジ日時 2023-09-29 19:01:43
合計ジャッジ時間 3,870 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,812 KB
testcase_01 AC 93 ms
71,796 KB
testcase_02 AC 94 ms
71,364 KB
testcase_03 AC 94 ms
71,744 KB
testcase_04 AC 92 ms
71,360 KB
testcase_05 AC 92 ms
71,732 KB
testcase_06 AC 92 ms
71,800 KB
testcase_07 AC 93 ms
71,540 KB
testcase_08 AC 91 ms
71,628 KB
testcase_09 AC 93 ms
71,796 KB
testcase_10 AC 95 ms
71,900 KB
testcase_11 AC 103 ms
77,680 KB
testcase_12 AC 103 ms
77,780 KB
testcase_13 AC 112 ms
77,744 KB
testcase_14 AC 107 ms
77,840 KB
testcase_15 AC 143 ms
77,628 KB
testcase_16 AC 155 ms
77,752 KB
testcase_17 AC 161 ms
78,076 KB
testcase_18 AC 166 ms
77,884 KB
testcase_19 AC 159 ms
78,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, = map(int, input().split())
from itertools import permutations
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
from collections import defaultdict
D = defaultdict(int)
mx = 0
for x in permutations(X, N):
    R = 0
    for i in range(N):
        a,b=x[i],Y[i]
        if a>b:
            R+=a-b
    D[R] += 1
    mx = max(R, mx)
print(D[mx])
0