# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
895782 | Isam | Autići (COCI22_autici) | C++17 | 11 ms | 1744 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
constexpr int sz = 100005;
int n;
int d[sz];
signed main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> n;
long long sm(0);
for(register int i = 1; i <= n; ++i){
cin >> d[i];
sm += d[i];
}
if(n == 1) return puts("0"), 0;
sort(d+1, d+n+1);
sm <<= 1;
sm -= (d[n] + d[n - 1]);
cout << sm << '\n';
return 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... |