제출 #526679

#제출 시각아이디문제언어결과실행 시간메모리
526679beepbeepsheepAutići (COCI22_autici)C++17
50 / 50
12 ms316 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ii pair<ll,ll> #define endl '\n' const ll inf=1e15; const ll mod=1e9+7; const ll maxn=1e5+5; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); ll n; cin>>n; if (n==1){ cout<<0; return 0; } ll sum=0,ele,mini=inf; for (int i=0;i<n;i++){ cin>>ele; sum+=ele; mini=min(ele,mini); } cout<<sum+mini*(n-2); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...