結果

問題 No.1279 Array Battle
ユーザー ibyiby
提出日時 2020-11-16 01:54:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 437 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 12,612 KB
最終ジャッジ日時 2023-09-30 07:09:33
合計ジャッジ時間 5,291 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
12,588 KB
testcase_01 AC 14 ms
8,128 KB
testcase_02 AC 15 ms
8,268 KB
testcase_03 AC 14 ms
8,176 KB
testcase_04 AC 13 ms
8,180 KB
testcase_05 AC 13 ms
8,120 KB
testcase_06 AC 13 ms
8,204 KB
testcase_07 AC 14 ms
8,312 KB
testcase_08 AC 13 ms
8,180 KB
testcase_09 AC 14 ms
8,084 KB
testcase_10 AC 14 ms
8,156 KB
testcase_11 AC 17 ms
8,124 KB
testcase_12 AC 48 ms
8,160 KB
testcase_13 AC 332 ms
8,280 KB
testcase_14 AC 324 ms
8,280 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
ans = 0
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))


maxvalue = 0
for v in permutations(a):
    submax = 0
    for i in range(n):
        submax += max(0, v[i] - b[i])
    maxvalue = max(maxvalue, submax)

for v in permutations(a):
    submax = 0
    for i in range(n):
        submax += max(0, v[i] - b[i])
    ans += int(submax == maxvalue)

print(ans)

0