Submission #558665

# Submission time Handle Problem Language Result Execution time Memory
558665 2022-05-08T01:28:50 Z pokmui9909 Fireworks (APIO16_fireworks) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll N, M;
ll P[300005], C[300005];

int main(){
    cin.tie(0) -> sync_with_stdio(false);

    cin >> N >> M;
    for(ll i = 1; i < N + M; i++){
        cin >> P[i] >> C[i];
    }
    sort(C + 1, C + N + M + 1);
    ll r = 0, m = C[(N + M + 1) / 2];
    for(ll i = 1; i <= N + M; i++){
        r += abs(m - C[i]);
    }
    cout << r;
}
# 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 Incorrect 1 ms 212 KB Output isn't correct
2 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 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -