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<algorithm>
#include<iostream>
#include<vector>
using namespace std;
int main(){
int n,m,i,j;
cin>>n>>m;
pair<int, int> a[n+1];
vector<int> b;
for(i=1; i<=n; i++)
{
cin>>a[i].first>>a[i].second;
}
for(j=1; j<n; j++)
{
for(i=j+1; i<=n; i++)
{
b.push_back(abs(a[i].first-a[i].second)+abs(a[j].first-a[j].second));
}
}
sort(b.begin(), b.end());
for(i=0; i<m; i++)
{
cout<<b[i]<<endl;
}
return 0;
}
# | 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... |