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;
typedef long long ll;
#define L first.first
#define R first.second
#define U second.first
#define D second.second
ll n, k;
pair<pair<ll, ll>, pair<ll, ll>> p[200001];
int main(){
cin >> n >> k;
for(int i=0; i<n; i++){
cin >> p[i].L >> p[i].D >> p[i].R >> p[i].U;
}
sort(p, p+n);
ll l=p[0].D, r=p[0].U;
for(int i=1; i<n; i++){
r=min(r, p[i].U);
l=max(l, p[i].D);
}
cout << p[n-1].L << " " << l;
return 0;
}
/*
3 1
*/
# | 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... |