結果

問題 No.1279 Array Battle
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-25 16:08:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,820 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 22,312 KB
最終ジャッジ日時 2023-09-16 09:30:05
合計ジャッジ時間 8,182 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,100 KB
testcase_01 AC 16 ms
8,124 KB
testcase_02 AC 15 ms
8,176 KB
testcase_03 AC 15 ms
8,048 KB
testcase_04 AC 15 ms
8,104 KB
testcase_05 AC 14 ms
8,072 KB
testcase_06 AC 15 ms
8,032 KB
testcase_07 AC 14 ms
8,048 KB
testcase_08 AC 15 ms
8,104 KB
testcase_09 AC 14 ms
8,124 KB
testcase_10 AC 15 ms
8,128 KB
testcase_11 AC 17 ms
8,124 KB
testcase_12 AC 33 ms
8,316 KB
testcase_13 AC 193 ms
9,760 KB
testcase_14 AC 186 ms
9,488 KB
testcase_15 AC 1,521 ms
11,032 KB
testcase_16 AC 1,535 ms
11,064 KB
testcase_17 AC 1,750 ms
22,268 KB
testcase_18 AC 1,820 ms
22,220 KB
testcase_19 AC 1,745 ms
22,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
from itertools import permutations
ans=[]
for seq in permutations(range(n)):
    cnt=0
    for i in range(n):
        cnt+=max(a[seq[i]]-b[i],0)
    ans.append(cnt)
num=max(ans)
print(ans.count(num))
0