This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |