#include <bits/stdc++.h>
int32_t main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, k;
std::cin >> n >> k;
std::vector<std::pair<int, int>> vec(n);
for (auto& [x, y] : vec) {
std::cin >> x >> y;
}
if (k == 1) {
int min_x = vec[0].first, min_y = vec[0].second;
int max_x = vec[0].first, max_y = vec[0].second;
for (auto [x, y] : vec) {
min_x = std::min(min_x, x);
min_y = std::min(min_y, y);
max_x = std::max(max_x, x);
max_y = std::max(max_y, y);
}
std::cout << min_x << " " << min_y << " " << std::max({1, max_x - min_x, max_y - min_y}) << std::endl;
return 0;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
14 ms |
1116 KB |
Output is correct |
8 |
Correct |
14 ms |
1116 KB |
Output is correct |
9 |
Correct |
15 ms |
1116 KB |
Output is correct |
10 |
Correct |
14 ms |
1116 KB |
Output is correct |
11 |
Correct |
15 ms |
1116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - int64 expected |
2 |
Halted |
0 ms |
0 KB |
- |