#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY LLONG_MAX
#define mod 998244353
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define FOR for(int i=1;i<=n;i++)
#define mid (start+end)/2
#define lim 2505
#define fi first
#define se second
vector<int> v[lim];
int32_t main(){
faster
int r,c,n;cin>>r>>c>>n;
FOR{
int x,y;cin>>x>>y;
v[x].push_back(y);
}
for(int i=1;i<=r;i++){
sort(v[i].begin(),v[i].end());
}
int q;cin>>q;
while(q--){
int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;
bool stop=1;
while(x1<=x2 && x1!=x2 && y1<=y2 && stop){
int tut=lower_bound(v[x1].begin(),v[x1].end(),y1)-v[x1].begin();
if(tut>=v[x1].size()){
stop=0;
break;
}
y1=v[x1][tut];
x1++;
}
if(x1==x2 && y1<=y2)stop=1;
if(stop){
cout<<"Yes"<<'\n';
}
else cout<<"No"<<'\n';
}
return 0;
}
Compilation message
trampoline.cpp: In function 'int32_t main()':
trampoline.cpp:36:10: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
36 | if(tut>=v[x1].size()){
| ~~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
604 KB |
expected NO, found YES [2nd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
3164 KB |
expected NO, found YES [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |