結果

問題 No.1279 Array Battle
ユーザー TakoKurageTakoKurage
提出日時 2020-11-07 17:52:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,090 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 8,740 KB
最終ジャッジ日時 2023-09-29 20:41:31
合計ジャッジ時間 6,500 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,480 KB
testcase_01 AC 15 ms
8,552 KB
testcase_02 AC 17 ms
8,428 KB
testcase_03 AC 17 ms
8,592 KB
testcase_04 AC 17 ms
8,476 KB
testcase_05 AC 17 ms
8,552 KB
testcase_06 AC 16 ms
8,488 KB
testcase_07 AC 16 ms
8,644 KB
testcase_08 AC 16 ms
8,484 KB
testcase_09 AC 16 ms
8,496 KB
testcase_10 AC 16 ms
8,556 KB
testcase_11 AC 18 ms
8,532 KB
testcase_12 AC 28 ms
8,484 KB
testcase_13 AC 124 ms
8,688 KB
testcase_14 AC 120 ms
8,520 KB
testcase_15 AC 946 ms
8,636 KB
testcase_16 AC 983 ms
8,500 KB
testcase_17 AC 1,090 ms
8,576 KB
testcase_18 AC 1,057 ms
8,648 KB
testcase_19 AC 1,067 ms
8,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
from collections import Counter

N, *AB = map(int, open(0).read().split())
A, B = AB[:N], AB[N:]

C = Counter(
    sum(max(0, p - b) for p, b in zip(P, B))
    for P in permutations(A)
)

ma = max(C.keys())
print(C[ma])
0