# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
696895 | Do_you_copy | Autići (COCI22_autici) | C++17 | 37 ms | 1656 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>
#define fi first
#define se second
#define faster ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back
using namespace std;
using ll = long long;
using pii = pair <int, int>;
const int maxN = 1e5 + 1;
const int inf = 0x3f3f3f3f;
int n;
int a[maxN];
void Init(){
cin >> n;
int minn = inf;
ll sum = 0;
for (int i = 1; i <= n; ++i){
cin >> a[i];
minn = min(minn, a[i]);
sum += a[i];
}
cout << sum + minn * (n - 2);
}
#define taskname "test"
signed main(){
if (fopen(taskname ".inp", "r")){
freopen(taskname ".inp", "r", stdin);
freopen(taskname ".out", "w", stdout);
}
int tt = 1;
//cin >> tt;
while (tt--){
Init();
}
}
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... |