# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
799351 | Tunglam07 | Autići (COCI22_autici) | C++17 | 5 ms | 596 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;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
if(n==1)
{
cout << 0;
return 0;
}
int sum,a[n+1];
for(int i=0;i<n;i++)
{
cin >> a[i];
sum+=a[i];
}
sort(a,a+n);
sum*=2;
sum=sum-a[n-1]-a[n-2];
cout << sum;
}
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... |