이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
typedef long long ll;
typedef long double ld;
const int maxn = 1e5+5;
const int inf = 1e9+5;
int n, mn = inf;
ll sum = 0;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for(int i = 0; i < n; i++){
int x;
cin >> x;
mn = min(mn, x);
sum += x;
}
//cout << mn << "\n";
cout << sum + 1LL*mn*(n-2);
//ifstream cin("input.txt");
//ofstream cout("output2.txt");
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |