# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
895782 | 2023-12-30T20:22:58 Z | Isam | Autići (COCI22_autici) | C++17 | 11 ms | 1744 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 5 ms | 860 KB | Output is correct |
3 | Correct | 9 ms | 1744 KB | Output is correct |
4 | Correct | 8 ms | 1624 KB | Output is correct |
5 | Correct | 9 ms | 1624 KB | Output is correct |
6 | Correct | 11 ms | 1648 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Incorrect | 0 ms | 472 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 5 ms | 860 KB | Output is correct |
3 | Correct | 9 ms | 1744 KB | Output is correct |
4 | Correct | 8 ms | 1624 KB | Output is correct |
5 | Correct | 9 ms | 1624 KB | Output is correct |
6 | Correct | 11 ms | 1648 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 1 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Incorrect | 0 ms | 472 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |