This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
long long N,A[100005];
int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> N;
    long long total = 0;
    for (long long i = 0; i < N; ++i) {
        cin >> A[i];
        total += A[i];
    }
    sort(A,A+N);
    cout << total + (N-2) * A[0];
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |