Submission #1015146

#TimeUsernameProblemLanguageResultExecution timeMemory
1015146vjudge1Fireworks (APIO16_fireworks)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; const int M = 105; int main() { int n,m; cin>>n>>m; int a[m]={}; for (int i=0;i<m;i++) cin>>a[i]>>a[i]; sort(a,a+m); int ind=m/2,ans=0; for (int i=0;i<m;i++) ans+=abs(a[ind]-a[i]); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...