이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (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... |