#include <bits/stdc++.h>
#define int long long
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define pb push_back
using namespace std;
signed main(){
int n,k;
cin>>n>>k;
vector <int> x(n),y(n);
for(int i=0;i<n;i++)cin>>x[i]>>y[i];
vector <int> v;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
v.pb(abs(x[i]-x[j])+abs(y[i]-y[j]));
}
}
sort(all(v));
for(int i=0;i<k;i++){
cout<<v[i]<<"\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
7056 KB |
Output is correct |
2 |
Correct |
57 ms |
7036 KB |
Output is correct |
3 |
Correct |
34 ms |
5052 KB |
Output is correct |
4 |
Correct |
35 ms |
5092 KB |
Output is correct |
5 |
Correct |
50 ms |
5816 KB |
Output is correct |
6 |
Correct |
18 ms |
6348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1583 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1056 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1056 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
7056 KB |
Output is correct |
2 |
Correct |
57 ms |
7036 KB |
Output is correct |
3 |
Correct |
34 ms |
5052 KB |
Output is correct |
4 |
Correct |
35 ms |
5092 KB |
Output is correct |
5 |
Correct |
50 ms |
5816 KB |
Output is correct |
6 |
Correct |
18 ms |
6348 KB |
Output is correct |
7 |
Runtime error |
703 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
7056 KB |
Output is correct |
2 |
Correct |
57 ms |
7036 KB |
Output is correct |
3 |
Correct |
34 ms |
5052 KB |
Output is correct |
4 |
Correct |
35 ms |
5092 KB |
Output is correct |
5 |
Correct |
50 ms |
5816 KB |
Output is correct |
6 |
Correct |
18 ms |
6348 KB |
Output is correct |
7 |
Runtime error |
1583 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |