Submission #413648

#TimeUsernameProblemLanguageResultExecution timeMemory
413648gvancakRoad Construction (JOI21_road_construction)C++11
5 / 100
10065 ms13388 KiB
#include <bits/stdc++.h> using namespace std; long long n,k,x[10001],y[10001],a[10000001],s; int main() { cin >> n >> k; for (int i=1; i<=n; i++){ cin >> x[i] >> y[i]; } for (int i=1; i<=n-1; i++){ for (int j=i+1; j<=n; j++){ a[s]= abs(x[i]-x[j])+abs(y[i]-y[j]); s++; } } sort(a,a+s); for (int i=0; i<k; i++){ cout<<a[i]<<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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...