加法的成本


Submit solution

Points: 100 (partial)
Time limit: 1.0s
Memory limit: 1G

Author:
Problem type

定義:加法的成本為每次相加結果的和。
現在給你 \(n\) 個數,試求這些數相加的最小成本。

輸入格式

首先有一整數 \(n, 1 \leq n <100000\)。
接下來一行有 \(n\) 個數 (\(< 100000\))。

輸出格式

請輸出最小成本。

範例輸入

3
1 2 3

範例輸出

9

Comments

There are no comments at the moment.