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;
int main()
{
long long n, a, minn = 1000000000, sum = 0;
cin>>n;
for(int i = 0; i < n; i++)
{
cin>>a;
minn = min(a, minn);
sum += a;
}
sum -= minn;
long long res = sum + minn * (n - 1);
cout<<res<<endl;
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... |