Submission #872642

#TimeUsernameProblemLanguageResultExecution timeMemory
872642HossamHero7Autići (COCI22_autici)C++14
50 / 50
15 ms2196 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl '\n' void solve(){ int n; cin>>n; vector<ll> v(n); for(auto &i:v) cin>>i; sort(v.begin(),v.end()); ll ans = v[0] * (n - 1); for(int i=1;i<n;i++) ans += v[i]; cout<<ans<<endl; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); 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...