#include <bits/stdc++.h>
#define int long long
using namespace std;
struct point{
int a, b;
};
vector<point> P;
int d(point x, point y){
return max(abs(x.a - y.a), abs(x.b - y.b));
}
int32_t main(){
int n, k; cin >> n >> k;
for(int i = 0; i < n; i++){
int x, y; cin >> x >> y;
P.push_back({x + y, x - y});
}
multiset<int> S;
for(int i = 0; i < n; i++){
for(int j = i + 1; j < n; j++){
S.insert(d(P[i], P[j]));
}
}
for(auto i : S){
if(k){
cout << i << endl;
k--;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
821 ms |
26320 KB |
Output is correct |
2 |
Correct |
821 ms |
26368 KB |
Output is correct |
3 |
Correct |
470 ms |
14632 KB |
Output is correct |
4 |
Correct |
520 ms |
14628 KB |
Output is correct |
5 |
Correct |
689 ms |
25136 KB |
Output is correct |
6 |
Correct |
215 ms |
23732 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10118 ms |
373076 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10101 ms |
371720 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10101 ms |
371720 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
821 ms |
26320 KB |
Output is correct |
2 |
Correct |
821 ms |
26368 KB |
Output is correct |
3 |
Correct |
470 ms |
14632 KB |
Output is correct |
4 |
Correct |
520 ms |
14628 KB |
Output is correct |
5 |
Correct |
689 ms |
25136 KB |
Output is correct |
6 |
Correct |
215 ms |
23732 KB |
Output is correct |
7 |
Execution timed out |
10057 ms |
378784 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
821 ms |
26320 KB |
Output is correct |
2 |
Correct |
821 ms |
26368 KB |
Output is correct |
3 |
Correct |
470 ms |
14632 KB |
Output is correct |
4 |
Correct |
520 ms |
14628 KB |
Output is correct |
5 |
Correct |
689 ms |
25136 KB |
Output is correct |
6 |
Correct |
215 ms |
23732 KB |
Output is correct |
7 |
Execution timed out |
10118 ms |
373076 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |