#include<bits/stdc++.h>
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
int x[n], y[n];
priority_queue<int, vector<int>, greater<int>> pq;
for(int i = 0;i<n;i++) {
cin >> x[i] >> y[i];
}
for(int i = 0;i<n;i++)
for(int j = i+1;j<n;j++)pq.push(abs(x[i]-x[j])+abs(y[i]-y[j]));
while(k--) {
cout << pq.top() << "\n";
pq.pop();
}
}
int main () {
cin.tie(0)->sync_with_stdio(0);
int t=1;
while(t--)solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
4996 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
5306 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
5057 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
5057 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
4996 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
4996 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |