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>
#define IO ios::sync_with_stdio(false);cin.tie(0);
#define debug(x) cerr << #x << " = " << (x) << ' '
#define endl cerr << '\n'
#define all(v) (v).begin(), (v).end()
#define SZ(v) (ll)(v).size()
#define lowbit(x) (x)&-(x)
#define pb emplace_back
#define F first
#define S second
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const int N = 1e5+5;
int L[N], R[N], D[N], U[N];
pll p[4];
inline bool chk(int x, int y, int j)
{
return L[j] <= x && x <= R[j] && D[j] <= y && y <= U[j];
}
int main(void)
{ IO
ll n, i, j, m;
bool ff;
cin >> n >> m;
for (i=1; i <= n; ++i) cin >> L[i] >> D[i] >> R[i] >> U[i];
for (i=1; i <= n; ++i)
{
p[0] = {L[i], D[i]}, p[1] = {L[i], U[i]};
p[2] = {R[i], D[i]}, p[3] = {R[i], U[i]};
ff = 0;
for (int d=0; d < 4; ++d)
{
for (j=1; j <= n; ++j)
{
if (i == j) continue;
if (!chk(p[d].F, p[d].S, j)) break;
}
if (j > n)
{
cout << p[d].F << ' ' << p[d].S << '\n';
exit(0);
}
}
}
assert(0);
return 0;
}
Compilation message (stderr)
hamburg.cpp: In function 'int main()':
hamburg.cpp:27:10: warning: variable 'ff' set but not used [-Wunused-but-set-variable]
27 | bool ff;
| ^~
# | 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... |