# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28260 | 2017-07-16T04:15:06 Z | Sorry AcornCkiGuiziTeam(#1226, gs13068) | Wine Tasting (FXCUP2_wine) | C++14 | 103 ms | 2288 KB |
#include <cstdio> #include <algorithm> using namespace std; int a[300003]; int main() { long long r = 0; int i, n, m; scanf("%d%d", &n, &m); for (i = 1; i <= n; i++) scanf("%d", &a[i]); sort(a, a + n + 1); for (i = 0; i + i < m; i++) r += a[n - i] - a[i]; printf("%lld", r); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2288 KB | Output is correct |
2 | Correct | 0 ms | 2288 KB | Output is correct |
3 | Correct | 0 ms | 2288 KB | Output is correct |
4 | Correct | 0 ms | 2288 KB | Output is correct |
5 | Correct | 0 ms | 2288 KB | Output is correct |
6 | Correct | 0 ms | 2288 KB | Output is correct |
7 | Correct | 0 ms | 2288 KB | Output is correct |
8 | Correct | 0 ms | 2288 KB | Output is correct |
9 | Correct | 0 ms | 2288 KB | Output is correct |
10 | Correct | 0 ms | 2288 KB | Output is correct |
11 | Correct | 0 ms | 2288 KB | Output is correct |
12 | Correct | 0 ms | 2288 KB | Output is correct |
13 | Correct | 0 ms | 2288 KB | Output is correct |
14 | Correct | 0 ms | 2288 KB | Output is correct |
15 | Correct | 0 ms | 2288 KB | Output is correct |
16 | Correct | 0 ms | 2288 KB | Output is correct |
17 | Correct | 3 ms | 2288 KB | Output is correct |
18 | Correct | 6 ms | 2288 KB | Output is correct |
19 | Correct | 9 ms | 2288 KB | Output is correct |
20 | Correct | 6 ms | 2288 KB | Output is correct |
21 | Correct | 26 ms | 2288 KB | Output is correct |
22 | Correct | 29 ms | 2288 KB | Output is correct |
23 | Correct | 29 ms | 2288 KB | Output is correct |
24 | Correct | 26 ms | 2288 KB | Output is correct |
25 | Correct | 96 ms | 2288 KB | Output is correct |
26 | Correct | 99 ms | 2288 KB | Output is correct |
27 | Correct | 93 ms | 2288 KB | Output is correct |
28 | Correct | 53 ms | 2288 KB | Output is correct |
29 | Correct | 103 ms | 2288 KB | Output is correct |
30 | Correct | 103 ms | 2288 KB | Output is correct |
31 | Correct | 99 ms | 2288 KB | Output is correct |
32 | Correct | 86 ms | 2288 KB | Output is correct |
33 | Correct | 0 ms | 2288 KB | Output is correct |
34 | Correct | 13 ms | 2288 KB | Output is correct |