Submission #696610

#TimeUsernameProblemLanguageResultExecution timeMemory
696610uyluluAutići (COCI22_autici)C++17
50 / 50
16 ms1108 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" const int N = 1e5; int num[N + 1]; signed main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); // freopen("in.txt","r",stdin); // freopen("out.txt","w",stdout); int n; cin>>n; int res = 0; for(int i = 1;i <= n;i++) { cin>>num[i]; } sort(num + 1,num + 1 + n); for(int i = 2;i <= n;i++) { res += (num[i] + num[1]); } cout<<res<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...