Submission #696682

#TimeUsernameProblemLanguageResultExecution timeMemory
696682tranxuanbachAutići (COCI22_autici)C++17
50 / 50
19 ms1708 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define fi first #define se second #define For(i, l, r) for (auto i = (l); i < (r); i++) #define ForE(i, l, r) for (auto i = (l); i <= (r); i++) #define FordE(i, l, r) for (auto i = (l); i >= (r); i--) #define Fora(v, a) for (auto v: (a)) #define bend(a) (a).begin(), (a).end() #define isz(a) ((signed)(a).size()) using ll = long long; using ld = long double; using pii = pair <int, int>; using vi = vector <int>; using vpii = vector <pii>; using vvi = vector <vi>; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("KEK.inp", "r", stdin); // freopen("KEK.out", "w", stdout); int n; cin >> n; vi a(n); For(i, 0, n){ cin >> a[i]; } sort(bend(a)); ll ans = 0; For(i, 1, n){ ans += a[0] + a[i]; } cout << ans << endl; } /* ==================================================+ INPUT | --------------------------------------------------| --------------------------------------------------| ==================================================+ OUTPUT | --------------------------------------------------| --------------------------------------------------| ==================================================+ */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...