제출 #970870

#제출 시각아이디문제언어결과실행 시간메모리
970870vjudge1Fireworks (APIO16_fireworks)C++14
7 / 100
0 ms500 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int n, m; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> m; vector<int> v; for (int i=2; i<=n+m; ++i){ int p, c; cin >> p >> c; v.push_back(c); } sort(v.begin(), v.end()); int val=v[m/2], ans=0; for (auto &i:v) ans+=abs(i-val); 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...