結果

問題 No.1279 Array Battle
ユーザー akitsugu777akitsugu777
提出日時 2020-12-15 11:02:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 412 bytes
コンパイル時間 886 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 17,456 KB
最終ジャッジ日時 2023-10-20 05:53:09
合計ジャッジ時間 5,142 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,172 KB
testcase_01 AC 29 ms
10,172 KB
testcase_02 AC 31 ms
10,172 KB
testcase_03 AC 30 ms
10,172 KB
testcase_04 AC 29 ms
10,172 KB
testcase_05 AC 30 ms
10,172 KB
testcase_06 AC 30 ms
10,172 KB
testcase_07 AC 30 ms
10,172 KB
testcase_08 AC 30 ms
10,172 KB
testcase_09 AC 29 ms
10,172 KB
testcase_10 AC 31 ms
10,172 KB
testcase_11 AC 35 ms
10,192 KB
testcase_12 AC 72 ms
10,368 KB
testcase_13 AC 384 ms
11,844 KB
testcase_14 AC 378 ms
11,664 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

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

L = []
for b in permutations(B):
    TOTAL = 0
    for i, j in zip(A, b):
        TOTAL += max(i-j, 0)
    L += [TOTAL]
MAX = max(L)

ANS = 0
for b in permutations(B):
    TOTAL = 0
    for i, j in zip(A, b):
        TOTAL += max(i-j, 0)
    if TOTAL == MAX:
        ANS += 1
print(ANS)
0