Submission #1018557

#TimeUsernameProblemLanguageResultExecution timeMemory
1018557vjudge1Autići (COCI22_autici)C++17
50 / 50
11 ms1372 KiB
#include <bits/stdc++.h> #define fast cin.tie(0)->sync_with_stdio(0); #define int long long #define inf ((int)1e18) using namespace std; int32_t main(){ fast int n; cin >> n; int in, sum = 0, mn = inf; for(int i = 0; i < n; i++) { int in; cin >> in; mn = min(mn, in); sum += in; } cout << sum + (n - 2) * mn; }

Compilation message (stderr)

Main.cpp: In function 'int32_t main()':
Main.cpp:11:6: warning: unused variable 'in' [-Wunused-variable]
   11 |  int in, sum = 0, mn = inf;
      |      ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...