結果

問題 No.1279 Array Battle
ユーザー KudeKude
提出日時 2020-11-06 21:27:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 451 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 78,564 KB
最終ジャッジ日時 2023-09-29 18:10:35
合計ジャッジ時間 4,527 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,392 KB
testcase_01 AC 64 ms
71,408 KB
testcase_02 AC 69 ms
75,468 KB
testcase_03 AC 66 ms
71,344 KB
testcase_04 AC 68 ms
71,220 KB
testcase_05 AC 66 ms
71,568 KB
testcase_06 AC 66 ms
71,560 KB
testcase_07 AC 66 ms
71,568 KB
testcase_08 AC 65 ms
71,428 KB
testcase_09 AC 68 ms
71,060 KB
testcase_10 AC 69 ms
75,444 KB
testcase_11 AC 95 ms
76,288 KB
testcase_12 AC 134 ms
78,440 KB
testcase_13 AC 149 ms
77,972 KB
testcase_14 AC 159 ms
78,300 KB
testcase_15 AC 337 ms
77,740 KB
testcase_16 AC 414 ms
78,564 KB
testcase_17 AC 451 ms
78,536 KB
testcase_18 AC 422 ms
78,136 KB
testcase_19 AC 401 ms
77,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations as perm
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
mx = -1
for p in perm(a):
    mx = max(mx, sum(max(0, x-y) for x, y in zip(p, b)))
cnt = 0
for p in perm(a):
    cnt += sum(max(0, x-y) for x, y in zip(p, b)) == mx
print(cnt)
0