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;
#define f first
#define s second
typedef long long ll;
typedef long double ld;
const int maxn = 1e5+5;
const int inf = 1e9+5;
int n, mn = inf;
ll sum = 0;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for(int i = 0; i < n; i++){
int x;
cin >> x;
mn = min(mn, x);
sum += x;
}
//cout << mn << "\n";
cout << sum + 1LL*mn*(n-2);
//ifstream cin("input.txt");
//ofstream cout("output2.txt");
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |