結果

問題 No.1279 Array Battle
ユーザー paruf4paruf4
提出日時 2020-11-06 21:55:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,260 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 10,488 KB
実行使用メモリ 65,240 KB
最終ジャッジ日時 2023-09-29 18:40:43
合計ジャッジ時間 7,052 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,080 KB
testcase_01 AC 15 ms
8,152 KB
testcase_02 AC 15 ms
8,188 KB
testcase_03 AC 14 ms
8,212 KB
testcase_04 AC 15 ms
8,168 KB
testcase_05 AC 15 ms
8,116 KB
testcase_06 AC 15 ms
8,048 KB
testcase_07 AC 14 ms
8,048 KB
testcase_08 AC 14 ms
8,164 KB
testcase_09 AC 15 ms
8,028 KB
testcase_10 AC 16 ms
8,188 KB
testcase_11 AC 16 ms
8,276 KB
testcase_12 AC 26 ms
8,800 KB
testcase_13 AC 119 ms
14,412 KB
testcase_14 AC 100 ms
14,400 KB
testcase_15 AC 687 ms
53,836 KB
testcase_16 AC 1,013 ms
53,836 KB
testcase_17 AC 1,205 ms
65,240 KB
testcase_18 AC 1,111 ms
65,232 KB
testcase_19 AC 1,260 ms
65,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
from itertools import permutations
p = []
for c in list(permutations(a)):
    tmp = 0
    for i in range(n):
        if c[i] > b[i]:
            tmp += abs(c[i]-b[i])
    p.append(tmp)
pmax = max(p)
res = 0
for pp in p:
    if pp == pmax:
        res += 1

print(res)

0