# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24979 | 2017-06-19T14:26:19 Z | gabrielsimoes | Fireworks (APIO16_fireworks) | C++14 | 0 ms | 2020 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n, m; scanf("%d %d", &n, &m); vector<int> v; v.resize(m+n); vector<int> p; p.resize(m+n); for (int i = 1; i < n+m; i++) scanf("%d %d", &p[i], &v[i]); if (n == 1) { sort(v.begin()+1, v.end()); ll ret = 0; for (int i = 1; i <= m; i++) ret += abs(v[(m+1)/2] - v[i]); return printf("%lld\n", ret), 0; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 0 ms | 2020 KB | Output is correct |
3 | Correct | 0 ms | 2020 KB | Output is correct |
4 | Correct | 0 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 0 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
8 | Correct | 0 ms | 2020 KB | Output is correct |
9 | Correct | 0 ms | 2020 KB | Output is correct |
10 | Correct | 0 ms | 2020 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 0 ms | 2020 KB | Output is correct |
3 | Correct | 0 ms | 2020 KB | Output is correct |
4 | Correct | 0 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 0 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
8 | Correct | 0 ms | 2020 KB | Output is correct |
9 | Correct | 0 ms | 2020 KB | Output is correct |
10 | Correct | 0 ms | 2020 KB | Output is correct |
11 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2020 KB | Output is correct |
2 | Correct | 0 ms | 2020 KB | Output is correct |
3 | Correct | 0 ms | 2020 KB | Output is correct |
4 | Correct | 0 ms | 2020 KB | Output is correct |
5 | Correct | 0 ms | 2020 KB | Output is correct |
6 | Correct | 0 ms | 2020 KB | Output is correct |
7 | Correct | 0 ms | 2020 KB | Output is correct |
8 | Correct | 0 ms | 2020 KB | Output is correct |
9 | Correct | 0 ms | 2020 KB | Output is correct |
10 | Correct | 0 ms | 2020 KB | Output is correct |
11 | Incorrect | 0 ms | 2020 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |