Submission #413627

#TimeUsernameProblemLanguageResultExecution timeMemory
413627vato_chachanidzeRoad Construction (JOI21_road_construction)C++14
5 / 100
2274 ms2097156 KiB
#include<bits/stdc++.h> using namespace std; long long n,k,i,l,i2; pair<long long,long long> xy[1000009],p1,p2; bool ok; vector<long long> ans; int main() { cin>>n>>k; for(i=1;i<=n;i++) { cin>>p1.first>>p1.second; xy[i]=p1; if(p1.second!=0) { ok=true; } } for(i=1;i<=n;i++) { for(i2=i+1;i2<=n;i2++) { ans.push_back(abs(xy[i2].first-xy[i].first)+abs(xy[i2].second-xy[i].second)); } } sort(ans.begin(),ans.end()); for(i=0;i<k;i++) { cout<<ans[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...