Submission #1077190

#TimeUsernameProblemLanguageResultExecution timeMemory
107719012345678Autići (COCI22_autici)C++17
50 / 50
11 ms2164 KiB
#include <bits/stdc++.h> using namespace std; const int nx=1e5+5; #define ll long long ll n, mn=LLONG_MAX, d[nx], res; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; for (int i=1; i<=n; i++) cin>>d[i], mn=min(mn, d[i]); res-=2*mn; for (int i=1; i<=n; i++) res+=d[i]+mn; cout<<res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...