結果

問題 No.1279 Array Battle
ユーザー akitsugu777akitsugu777
提出日時 2020-12-15 10:53:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 518 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 24,496 KB
最終ジャッジ日時 2023-10-20 05:52:21
合計ジャッジ時間 12,831 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,080 KB
testcase_01 AC 29 ms
10,080 KB
testcase_02 AC 28 ms
10,080 KB
testcase_03 AC 28 ms
10,080 KB
testcase_04 AC 28 ms
10,080 KB
testcase_05 AC 28 ms
10,080 KB
testcase_06 AC 28 ms
10,080 KB
testcase_07 AC 29 ms
10,080 KB
testcase_08 AC 28 ms
10,080 KB
testcase_09 AC 28 ms
10,080 KB
testcase_10 AC 29 ms
10,080 KB
testcase_11 AC 31 ms
10,100 KB
testcase_12 AC 49 ms
10,272 KB
testcase_13 AC 230 ms
11,752 KB
testcase_14 AC 216 ms
11,572 KB
testcase_15 AC 1,693 ms
13,008 KB
testcase_16 AC 1,797 ms
13,008 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

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):
        if i > j:
            TOTAL += i - j
        else:
            TOTAL += 0
    L += [TOTAL]
MAX = max(L)

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