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 endl '\n'
typedef long long ll;
int v[100001];
int n;
ll ans;
ll mi = LLONG_MAX; int min_index;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
cin >> n;
for(int i = 1; i <= n; i++) {
cin >> v[i];
if(v[i] < mi) {
min_index = i;
mi = v[i];
}
}
for(int i = 1; i <= n; i++) {
if(i != min_index) ans += v[i] + mi;
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |