Submission #867711

#TimeUsernameProblemLanguageResultExecution timeMemory
867711epicci23Autići (COCI22_autici)C++17
50 / 50
15 ms2252 KiB
#include "bits/stdc++.h" using namespace std; #define pb push_back #define endl "\n" #define int long long #define sz(x) ((int)(x).size()) #define all(x) (x).begin(),(x).end() void solve(){ int n; cin >> n; vector<int> v(n); for(int& x:v) cin >> x; sort(all(v)); int ans=0; for(int i=1;i<n;i++) ans+=v[i]+v[0]; cout << ans << endl; } int32_t main(){ cin.tie(0); ios::sync_with_stdio(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...