Submission #696612

#TimeUsernameProblemLanguageResultExecution timeMemory
696612Hiennoob123Autići (COCI22_autici)C++17
50 / 50
14 ms1836 KiB
#include <bits/stdc++.h> #define ll long long #define pll pair<ll,ll> #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; const ll maxn = 5e5+5; const ll add = 1e5; ll n; ll A[maxn]; void solve() { cin >> n; ll sum = 0; ll value = LLONG_MAX; for(int i = 1; i<= n; i++) { cin >> A[i]; sum += A[i]; value = min(value, A[i]); } sum -= value; sum += (n-1)*value; cout << sum; } int main() { ios_base::sync_with_stdio(NULL) ; cin.tie(nullptr) ; cout.tie(nullptr); ll test_case = 1; while(test_case--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...