# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
553243 | kappa | Autići (COCI22_autici) | C++14 | 0 ms | 0 KiB |
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> //bakarız bakarız
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;
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;
}