//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
#include <bits/stdc++.h>
#define ll int
#define int int
#define all(v) v.begin(), v.end()
#define nl '\n'
#define pb push_back
#define sz(s) (int)(s).size()
#define f first
#define s second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const ll N = 1e5+10, MX = 1e9+1, MOD = 1e9 + 7;
void solve(){
ll R, C, n;
cin >> R >> C >> n;
ll N = R, M = C;
set <int> g[N+2];
for(int i = 1; i <= n; i++){
ll x, y;
cin >> x >> y;
g[x].insert(y);
}
ll q;
cin >> q;
while(q--){
ll x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
ll curx = x1, cury = y1;
if(x1 > x2){
ll ok = x2;
x2 = x1;
x1 = ok;
ok = y2;
y2 = y1;
y1 = ok;
}
if(x1 == x2 && y1 <= y2){
cout << "YES" << nl;
continue;
}
while(true){
auto pos = g[curx].lower_bound(cury);
if(pos == g[curx].end()){
cout << "NO" << nl;
break;
}
//cout << *pos << " " << curx << " " << cury << nl;
if(curx + 1 == x2 && *pos <= y2){
cout << "YES" << nl;
break;
}
curx++;
cury = *pos;
}
}
}
main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
ll ql =1;
while(ql--){
solve();
}
}
컴파일 시 표준 에러 (stderr) 메시지
trampoline.cpp:61:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
61 | main(){
| ^~~~
# | 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... |