#include <bits/stdc++.h>
using namespace std;
long long N,K;
pair<long long,long long> lst[250005];
vector<long long> A;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin >> N >> K;
for (long long i = 0; i < N; ++i) cin >> lst[i].first >> lst[i].second;
for (long long i = 0; i < N; ++i) for (long long j = i+1; j < N; ++j)
A.push_back(abs(lst[i].first-lst[j].first)+abs(lst[i].second-lst[j].second));
sort(A.begin(),A.end());
for (long long i = 0; i < K; ++i) cout << A[i] << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
6980 KB |
Output is correct |
2 |
Correct |
75 ms |
6976 KB |
Output is correct |
3 |
Correct |
48 ms |
5092 KB |
Output is correct |
4 |
Correct |
40 ms |
5060 KB |
Output is correct |
5 |
Correct |
56 ms |
5816 KB |
Output is correct |
6 |
Correct |
20 ms |
4556 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1582 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1676 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1676 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
6980 KB |
Output is correct |
2 |
Correct |
75 ms |
6976 KB |
Output is correct |
3 |
Correct |
48 ms |
5092 KB |
Output is correct |
4 |
Correct |
40 ms |
5060 KB |
Output is correct |
5 |
Correct |
56 ms |
5816 KB |
Output is correct |
6 |
Correct |
20 ms |
4556 KB |
Output is correct |
7 |
Runtime error |
1642 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
6980 KB |
Output is correct |
2 |
Correct |
75 ms |
6976 KB |
Output is correct |
3 |
Correct |
48 ms |
5092 KB |
Output is correct |
4 |
Correct |
40 ms |
5060 KB |
Output is correct |
5 |
Correct |
56 ms |
5816 KB |
Output is correct |
6 |
Correct |
20 ms |
4556 KB |
Output is correct |
7 |
Runtime error |
1582 ms |
2097152 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |