# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
895783 | Isam | Autići (COCI22_autici) | C++17 | 9 ms | 828 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;
unsigned 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... |