# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
845175 | samekkk | Trampoline (info1cup20_trampoline) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a,b) for (int a = 0; a < (b); ++a)
#define pb push_back
#define all(t) t.begin(), t.end()
struct Pole
{
int y=-1,x=-1;
};
const int max_W = 2505;
int wysokosc = 0, szerokosc = 0, n = 0, y = 0, x = 0, q = 0, y_1 = 0, y_2 = 0, x_1 = 0, x_2 = 0;
int A[max_W][max_W];
Pole nextt[max_W][max_W];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> wysokosc >> szerokosc >> n;
rep(i,n)
{
cin >> y >> x;
--y, --x;
A[y][x] = 1;
}
cin >> q;
while(q--)
{
cin >> y_1 >> x_1 >> y_2 >> x_2;
--y_1, --y_2, --x_1, --x_2;
if (y_1 > y_2 pr x_1 > x_2)
{
cout << "No" << '\n';
continue;
}
bool czy_OK = false;
while(y_1 <= y_2 and x_1 <= x_2)
{
if (y_1 == y_2 and x_1 == x_2) czy_OK = true;
if (A[y_1][x_1] == 0) ++x_1;
else ++y_1;
}
if (czy_OK) cout << "Yes" << '\n';
else cout << "No" << '\n';
}
return 0;
}