Submission #851235

#TimeUsernameProblemLanguageResultExecution timeMemory
851235dostsAutići (COCI22_autici)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define sp << " " << #define int long long #define vi vector<int> #define pb push_back const int N = 1e5+1; void solve() { int n; cin >> n; vi a(n+1); for (int i=1;i<=n;i++) cin >> a[i]; int sm =0; for (int i=1;i<=n;i++) sm+=a[i]; int mn = *min_element(a.begin()+1,a.end()); cout << (n-1)*mn+sm-mn << endl;5 } signed main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int t = 1; //cin >> t; while (t --> 0) solve(); }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:18:34: error: expected ';' before '}' token
   18 |  cout << (n-1)*mn+sm-mn << endl;5
      |                                  ^
      |                                  ;
   19 | }
      | ~                                 
Main.cpp:18:33: warning: statement has no effect [-Wunused-value]
   18 |  cout << (n-1)*mn+sm-mn << endl;5
      |                                 ^