Submission #895782

#TimeUsernameProblemLanguageResultExecution timeMemory
895782IsamAutići (COCI22_autici)C++17
10 / 50
11 ms1744 KiB
#include<bits/stdc++.h> using namespace std; constexpr int sz = 100005; int n; int d[sz]; signed main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); cin >> n; long long sm(0); for(register int i = 1; i <= n; ++i){ cin >> d[i]; sm += d[i]; } if(n == 1) return puts("0"), 0; sort(d+1, d+n+1); sm <<= 1; sm -= (d[n] + d[n - 1]); cout << sm << '\n'; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:12:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |  for(register int i = 1; i <= n; ++i){
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...