#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n, sum;
void fun()
{
cin>>n;
ll arr[n + 1];
for(int i = 1; i <= n; i++)
cin>>arr[i], sum += arr[i];
sort(arr + 1, arr + 1 + n);
cout<< arr[1] * (n - 1) + sum;
}
signed main(){
ll ttt = 1;
//cin>>ttt;
while(ttt--)
fun();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
304 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |