結果

問題 No.1279 Array Battle
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-25 16:09:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 90,280 KB
最終ジャッジ日時 2023-09-16 09:35:04
合計ジャッジ時間 3,181 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,356 KB
testcase_01 AC 70 ms
71,628 KB
testcase_02 AC 70 ms
71,456 KB
testcase_03 AC 72 ms
71,420 KB
testcase_04 AC 69 ms
71,352 KB
testcase_05 AC 69 ms
71,292 KB
testcase_06 AC 68 ms
71,380 KB
testcase_07 AC 70 ms
71,424 KB
testcase_08 AC 70 ms
71,284 KB
testcase_09 AC 70 ms
71,228 KB
testcase_10 AC 70 ms
71,288 KB
testcase_11 AC 78 ms
76,744 KB
testcase_12 AC 78 ms
76,828 KB
testcase_13 AC 87 ms
78,432 KB
testcase_14 AC 85 ms
78,792 KB
testcase_15 AC 131 ms
90,280 KB
testcase_16 AC 143 ms
89,544 KB
testcase_17 AC 143 ms
89,780 KB
testcase_18 AC 149 ms
89,912 KB
testcase_19 AC 146 ms
89,624 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