# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
793383 | 2023-07-25T18:52:44 Z | kingfran1907 | Fireworks (APIO16_fireworks) | C++14 | 0 ms | 212 KB |
#include <bits/stdc++.h> using namespace std; typedef long long llint; const int maxn = 2e5+10; int n, m; int parr[maxn], len[maxn]; int main() { scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) scanf("%d", len+i); sort(len, len+m); int ac = (m / 2); llint sol = 0; for (int i = 0; i < m; i++) sol += abs(len[ac] - len[i]); printf("%lld\n", sol); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |