[アルゴリズム/標準]1026号:宝蔵(python)


易しい解ですね.aを予め位置合わせし、for文でaを1つずつ取り出す.b最大を乗じるだけで、結果にremoveを乗じる
n = int(input())
a = sorted(list(map(int, input().split())))
b = list(map(int, input().split()))
tot = 0
for i in a:
tot += max(b) * i
b.remove(max(b))
print(tot)
Reference
この問題について([アルゴリズム/標準]1026号:宝蔵(python)), 我々は、より多くの情報をここで見つけました https://velog.io/@y7y1h13/알고리즘백준-1026번-보물pythonテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol