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 <iostream>
#include <climits>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int nums; cin >> nums;
ll minlen = LLONG_MAX, sum = 0;
for (int i = 0; i < nums; i++) {
ll x; cin >> x;
minlen = min(minlen, x);
sum += x;
}
sum -= minlen;
cout << minlen * (nums - 1) + sum;
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... |