#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 1000005
#define fi first
#define se second
vector<pair<int,int>> v;
int32_t main(){
faster
int r,c,n;cin>>r>>c>>n;
FOR{
int x,y;cin>>x>>y;
v.push_back({x,y});
}
sort(v.begin(),v.end());
int q;cin>>q;
while(q--){
int x1,y1,x2,y2;cin>>x1>>y1>>x2>>y2;
bool stop=0;
for(int i=0;i<v.size();i++){
//cout<<x1<<" "<<y1<<endl;
if(v[i].fi<x1){
continue;
}
if(v[i].fi==x1 && y1<=v[i].se){
x1++;
y1=v[i].se;
}
if(x1==x2 && y1<=y2){
stop=1;
break;
}
}
if(stop){
cout<<"Yes"<<'\n';
}
else cout<<"No"<<'\n';
}
return 0;
}
Compilation message
trampoline.cpp: In function 'int32_t main()':
trampoline.cpp:32:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
32 | for(int i=0;i<v.size();i++){
| ~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
856 KB |
200 token(s): yes count is 21, no count is 179 |
2 |
Correct |
4 ms |
856 KB |
200 token(s): yes count is 70, no count is 130 |
3 |
Correct |
2 ms |
604 KB |
197 token(s): yes count is 25, no count is 172 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
390 ms |
6100 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
423 ms |
6096 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
399 ms |
5840 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Correct |
456 ms |
6100 KB |
4000 token(s): yes count is 1991, no count is 2009 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2045 ms |
8432 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
852 KB |
expected YES, found NO [1403rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2028 ms |
7928 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |