Submission #540594

#TimeUsernameProblemLanguageResultExecution timeMemory
540594AlperenTAutići (COCI22_autici)C++17
50 / 50
18 ms2028 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; long long n, arr[N]; int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); cin >> n; for(int i = 1; i <= n; i++) cin >> arr[i]; sort(arr + 1, arr + n + 1); cout << accumulate(arr + 2, arr + n + 1, 0ll) + (n - 1) * arr[1]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...