Submission #698036

#TimeUsernameProblemLanguageResultExecution timeMemory
698036GitalAutići (COCI22_autici)C++11
50 / 50
16 ms1672 KiB
#include<bits/stdc++.h> using namespace std; #define endl '\n' typedef long long ll; int v[100001]; int n; ll ans; ll mi = LLONG_MAX; int min_index; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for(int i = 1; i <= n; i++) { cin >> v[i]; if(v[i] < mi) { min_index = i; mi = v[i]; } } for(int i = 1; i <= n; i++) { if(i != min_index) ans += v[i] + mi; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...