# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1273331 | SmuggingSpun | Autići (COCI22_autici) | C++20 | 13 ms | 580 KiB |
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
int n;
cin >> n;
vector<int>a(n);
for(int& x : a){
cin >> x;
}
sort(a.begin(), a.end());
ll ans = 0;
for(int i = 1; i < n; i++){
ans += a[i];
}
cout << ans + 1LL * (n - 1) * a[0];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |