#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";
}
}
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1583 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1056 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1056 ms |
2097156 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |