# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881206 | Youssif_Elkadi | Autići (COCI22_autici) | C++17 | 31 ms | 2196 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;
const long long N = 2e5 + 5, inf = 1e17 + 5, mod = 1e9 + 7;
int main()
{
int n;
cin >> n;
long long ans = 0;
long long mn = inf, ind;
vector<long long> arr(n);
for (int i = 0; i < n; i++)
{
cin >> arr[i];
if (arr[i] < mn)
mn = arr[i], ind = i;
}
for (int i = 0; i < n; i++)
{
if (ind == i)
continue;
ans += mn + arr[i];
}
cout << ans;
}
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... |