Submission #950453

#TimeUsernameProblemLanguageResultExecution timeMemory
950453UnforgettableplFireworks (APIO16_fireworks)C++17
7 / 100
1 ms452 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int arr[100]; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int m; cin >> m >> m; for(int i=0;i<m;i++)cin>>arr[i]>>arr[i]; int ans = 0; sort(arr,arr+m); for(int i=0;i<m;i++)ans+=abs(arr[i]-arr[m/2]); cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...