Submission #1106117

#TimeUsernameProblemLanguageResultExecution timeMemory
1106117atomAutići (COCI22_autici)C++17
50 / 50
15 ms1848 KiB
#include "bits/stdc++.h" // @JASPER'S BOILERPLATE using namespace std; using ll = long long; #ifdef JASPER #include "debug.h" #else #define debug(...) 166 #endif signed main() { cin.tie(0) -> sync_with_stdio(0); #ifdef JASPER freopen("in1", "r", stdin); #endif int n; cin >> n; if (n == 1) { cout << "0\n"; return 0; } vector <int> d(n); for (int& x : d) cin >> x; sort(d.begin(), d.end()); ll ans = 0; for (int i = 1; i < n; ++i) ans += d[i] + d[0]; cout << ans << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...