Submission #696605

#TimeUsernameProblemLanguageResultExecution timeMemory
696605socpiteAutići (COCI22_autici)C++17
50 / 50
13 ms592 KiB
#include<bits/stdc++.h> using namespace std; #define f first #define s second typedef long long ll; typedef long double ld; const int maxn = 1e5+5; const int inf = 1e9+5; int n, mn = inf; ll sum = 0; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin >> n; for(int i = 0; i < n; i++){ int x; cin >> x; mn = min(mn, x); sum += x; } //cout << mn << "\n"; cout << sum + 1LL*mn*(n-2); //ifstream cin("input.txt"); //ofstream cout("output2.txt"); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...