This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n,k;
cin >> n >> k;
assert(k==1);
pair<int,int> curr_x = {1,1e9};
pair<int,int> curr_y = {1,1e9};
auto combine = [&](pair<int,int> a,pair<int,int> b){
return make_pair(max(a.first,b.first),min(a.second,b.second));
};
for(int i=1;i<=n;i++){
pair<int,int> x,y;
cin >> x.first >> y.first >> x.second >> y.second;
curr_x = combine(curr_x,x);
curr_y = combine(curr_y,y);
}
cout << curr_x.first << ' ' << curr_y.first << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |