Submission #534818

#TimeUsernameProblemLanguageResultExecution timeMemory
534818phathnvAutići (COCI22_autici)C++11
50 / 50
19 ms1684 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int &x : a) { cin >> x; } sort(a.begin(), a.end()); cout << accumulate(a.begin(), a.end(), 0ll) + 1ll * a[0] * (n - 2) << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...