Submission #1015283

#TimeUsernameProblemLanguageResultExecution timeMemory
1015283vjudge1Fireworks (APIO16_fireworks)C++17
7 / 100
1 ms440 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, m; cin >> n >> m; ll a[m]; for (ll i = 2; i <= n + m; i ++){ ll p; cin >> p >> a[i - 2]; } ll res = 1e18; for (ll i = 0; i < m; i ++){ ll ans = 0; for (ll j = 0; j < m; j ++){ ans += abs(a[i] - a[j]); } res = min(res, ans); } cout << res << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...