Submission #1024226

#TimeUsernameProblemLanguageResultExecution timeMemory
1024226vjudge1Fireworks (APIO16_fireworks)C++17
7 / 100
1 ms360 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; int main () { cin.tie(nullptr) -> sync_with_stdio(false); ll n, m; cin >> n >> m; vll ve(m); for (ll &i : ve) cin >> i >> i; sort(ve.begin(), ve.end()); ll ans = 0; for (ll i = 0; i < m; i++) { ans += abs(ve[i] - ve[m/2]); } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...