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;
typedef long long ll;
#define pb push_back
#define st first
#define nd second
#define MOD 1000000007
typedef pair<ll, ll> pii;
const ll maxn = 2e5 + 5;
ll n, sum, mn = INT_MAX;
int main(){
cin >> n;
for (int i = 0; i < n; i++)
{
ll x;
cin >> x;
sum += x;
mn = min(mn, x);
}
cout << (n - 2) * mn + sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |