#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
#define pb push_back
#define ll long long
//#define sort(all(v)) sort(v.begin(),v.end())
int mod = 998244353;
const int N = 3000 + 10;
const int inf = 1e9;
int fact[200001];
ll binpow(ll a, ll b){
if(b == 0) return 1;
else if(b % 2 == 1) return (a * binpow(a, b - 1)) % mod;
ll p = binpow(a,b / 2);
return (p * p) % mod;
}
int a[N][N];
signed main(){
//freopen("mootube.in", "r", stdin);
//freopen("mootube.out", "w", stdout);
int r,c,n;
cin >> r >> c >> n;
for(int i = 1; i <= n; i++){
int x,y;
cin >> x >> y;
a[x][y] = 1;
}
int t;
cin >> t;
while(t--){
int x,y,x1,y1;
cin >> x >> y >> x1 >> y1;
bool f = 0;
while(true){
while(y <= y1 && a[x][y] != 1){
y++;
}
if(y > y1){
f = 1;
break;
}
x++;
if(x == x1){
break;
}
}
if(x == x1) f = 0;
else if(x > x1 || y > y1) f = 1;
if(f == 0) cout << "Yes\n";
else cout << "No\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... |