Submission #526675

#TimeUsernameProblemLanguageResultExecution timeMemory
526675hmm789Autići (COCI22_autici)C++14
50 / 50
12 ms572 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, a; cin >> n; int sm = 0, mn = 1e9; for(int i = 0; i < n; i++) { cin >> a; sm += a; mn = min(a, mn); } cout << sm + (n-2)*mn; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...