Submission #1015217

#TimeUsernameProblemLanguageResultExecution timeMemory
1015217vjudge1Fireworks (APIO16_fireworks)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int const N=2e5+5; int const mod=1e9+7; int n,m; void solve1(){ int l[m+1]={0}; for (int i = 1; i <=m; ++i) { int a; cin>>a; cin>>l[m]; } ll ans=1e15; for(int i=1;i<=n;i++){ ll t=0; for(int j=1;j<=m;j++) t+=abs(l[j]-l[i]); ans=min(t,ans); } cout<<ans<<endl; } int main(){ cin>>n>>m; if(n==1 && m<=100){ solve1(); return 0; } 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...