#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 |
1 |
Incorrect |
517 ms |
4956 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2219 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2268 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2268 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
517 ms |
4956 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
517 ms |
4956 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |