#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
#define ff first
#define ss second
#define eack emplace_back
vector<pii> solve(vector<pair<pii, pii>> &v, int k) {
if (v.empty()) return {pii(1, 1)};
int xr = 0, xl = 1e9, yr = 0, yl = 1e9;
for (auto i : v) {
xl = min(xl, i.ss.ff);
yl = min(yl, i.ss.ss);
xr = max(xr, i.ff.ff);
yr = max(yr, i.ff.ss);
}
if (k == 1) {
if (xl < xr || yl < yr) return {pii(0, 0)};
return {pii(xl, yl)};
}
assert(0);
if (k == 2) {
}
if (k == 3) {
}
if (k == 4) {
}
}
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int N, K; cin >> N >> K;
vector<pair<pii, pii>> v;
for (int i = 0; i < N; ++i) {
int a, b, c, d; cin >> a >> b >> c >> d;
v.eack(pii(a, b), pii(c, d));
}
auto ans = solve(v, K);
for (auto i : ans) cout << i.ff << ' ' << i.ss << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
102 ms |
4584 KB |
Output is correct |
6 |
Correct |
103 ms |
4584 KB |
Output is correct |
7 |
Correct |
102 ms |
4584 KB |
Output is correct |
8 |
Correct |
97 ms |
4584 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |