# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
895783 | 2023-12-30T20:27:52 Z | Isam | Autići (COCI22_autici) | C++17 | 9 ms | 828 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; unsigned 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 604 KB | Output is correct |
3 | Correct | 8 ms | 816 KB | Output is correct |
4 | Correct | 8 ms | 828 KB | Output is correct |
5 | Correct | 8 ms | 604 KB | Output is correct |
6 | Correct | 9 ms | 604 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Incorrect | 1 ms | 348 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 604 KB | Output is correct |
3 | Correct | 8 ms | 816 KB | Output is correct |
4 | Correct | 8 ms | 828 KB | Output is correct |
5 | Correct | 8 ms | 604 KB | Output is correct |
6 | Correct | 9 ms | 604 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Incorrect | 1 ms | 348 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |