#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 1000000000000000000
#define MOD 1000000007
const int B = 730;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, k;
cin >> n >> k;
int x[n], y[n];
for(int i = 0; i < n; i++) cin >> x[i] >> y[i];
vector<int> ans;
for(int i = 0; i < n; i++) {
for(int j = 0; j < i; j++) {
ans.push_back(abs(x[i]-x[j])+abs(y[i]-y[j]));
}
}
sort(ans.begin(), ans.end());
for(int i = 0; i < k; i++) cout << ans[i] << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
7104 KB |
Output is correct |
2 |
Correct |
72 ms |
7084 KB |
Output is correct |
3 |
Correct |
48 ms |
5132 KB |
Output is correct |
4 |
Correct |
43 ms |
5060 KB |
Output is correct |
5 |
Correct |
50 ms |
6356 KB |
Output is correct |
6 |
Correct |
20 ms |
4560 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1670 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1254 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1254 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
7104 KB |
Output is correct |
2 |
Correct |
72 ms |
7084 KB |
Output is correct |
3 |
Correct |
48 ms |
5132 KB |
Output is correct |
4 |
Correct |
43 ms |
5060 KB |
Output is correct |
5 |
Correct |
50 ms |
6356 KB |
Output is correct |
6 |
Correct |
20 ms |
4560 KB |
Output is correct |
7 |
Runtime error |
1108 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
7104 KB |
Output is correct |
2 |
Correct |
72 ms |
7084 KB |
Output is correct |
3 |
Correct |
48 ms |
5132 KB |
Output is correct |
4 |
Correct |
43 ms |
5060 KB |
Output is correct |
5 |
Correct |
50 ms |
6356 KB |
Output is correct |
6 |
Correct |
20 ms |
4560 KB |
Output is correct |
7 |
Runtime error |
1670 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |