제출 #1268893

#제출 시각아이디문제언어결과실행 시간메모리
1268893khoadAutići (COCI22_autici)C++20
50 / 50
7 ms444 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define inf32 ((int)1e9 + 7) #define inf64 ((long long)1e18 + 7) #define MASK32(x) (1 << (x)) #define MASK64(x) (1ll << (x)) #define BIT(mask, i) (((mask) >> (i)) & 1) #define all(a) begin(a), end(a) #define isz(a) ((int)a.size()) const int N = 1e5 + 1; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; long long s = 0, mn = inf32; cin >> n; for(int i = 1, x; i <= n; ++i) { cin >> x; s += x; mn = min(mn, 1ll * x); } cout << (s - mn) + mn * (n - 1); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...