Submission #696615

#TimeUsernameProblemLanguageResultExecution timeMemory
696615Tuanlinh123Autići (COCI22_autici)C++17
50 / 50
16 ms1108 KiB
#include<bits/stdc++.h> #define ll long long #define ld long double #define pll pair<ll,ll> #define mp make_pair #define pb push_back #define fi first #define se second using namespace std; #define LOCALIO "C:/Users/admin/Documents/Code/" ll a[100005]; int main() { #ifdef LOCAL freopen( LOCALIO "input.txt","r",stdin) ; freopen( LOCALIO "output.txt","w",stdout) ; #endif ios_base::sync_with_stdio(NULL); cin.tie(nullptr); cout.tie(nullptr); // freopen("FIBONACCI.inp","r",stdin); // freopen("FIBONACCI.out","w",stdout); ll n; cin >> n; for (ll i=1; i<=n; i++) cin >> a[i]; sort(a+1, a+n+1); ll ans=0; for (ll i=2; i<=n; i++) ans+=a[i]+a[1]; cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...