Submission #1300841

#TimeUsernameProblemLanguageResultExecution timeMemory
1300841Sir_Ahmed_ImranAutići (COCI22_autici)C++20
50 / 50
8 ms580 KiB
            //    01001100 01001111 01010100 01000001    \\
            //                                           \\
            //                ╦  ╔═╗╔╦╗╔═╗               \\
            //                ║  ║ ║ ║ ╠═╣               \\
            //                ╩═╝╚═╝ ╩ ╩ ╩               \\
            //                                           \\
            //    01001100 01001111 01010100 01000001    \\
 
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define ll long long
#define ld long double
#define terminator main
#define pll pair<ll,ll>
#define add insert
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

const int N = 1e6 + 6;

void solve(){
    ll n, m, o, ans;
    cin >> n;
    o = 1e9;
    ans = 0;
    for(int i = 0; i < n; i++){
        cin >> m;
        ans += m;
        o = min(o, m); 
    }
    ans += (n - 2) * o;
    cout << ans << nl;
}

int terminator(){
    L0TA;
    int T = 1;
    //cin >> T;
    while(T--)
        solve();
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...