#include <bits/stdc++.h>
#define ll long long
#define sz size()
#define pb push_back
#define all(x) x.begin() , x.end()
using namespace std;
int main()
{
int r , c , n ; cin >> r >>c >> n ;
map<int,vector<int> >mp;
vector<pair<int,int>> temp ;
for (int i = 0; i < n; i++)
{
int a, b ; cin >> a >> b;
temp.pb({a , b}) ;
}
sort(all(temp)) ;
for (int i = 0; i < n; i++)
{
mp[temp[i].first].pb(temp[i].second);
}
int t ; cin >> t;
for (int i = 0; i < t; i++)
{
vector<int> v ; bool ok= 0 ;
int sx , sy , ex , ey ; cin >> sx >> sy >> ex >> ey;
//if(ex < sx || ey < sy || !mp.count(sx)) { cout<<"N0\n"; continue; }
v.pb(sy);
for(int j = sx ; j < ex ; j ++ ){
if(mp.count(j) == 0) { ok = 1;break; }
auto itt = lower_bound(all(mp[j]) , sy) ;
if(itt==mp[j].end()) { v.pb(-1);ok=1; break ; }
v.pb(*itt) ;
sy = *itt ;
//cout<<sy<<" " ;
}
if(ey >= sy && ok == 0 )cout<<"Yes\n"; else cout<<"No\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
600 KB |
expected NO, found YES [27th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
128 ms |
3260 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
124 ms |
3312 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
213 ms |
3008 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Incorrect |
534 ms |
3260 KB |
expected NO, found YES [1000th token] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
548 ms |
3772 KB |
200000 token(s): yes count is 110486, no count is 89514 |
2 |
Correct |
596 ms |
3520 KB |
200000 token(s): yes count is 114664, no count is 85336 |
3 |
Correct |
554 ms |
3516 KB |
200000 token(s): yes count is 86232, no count is 113768 |
4 |
Correct |
623 ms |
3776 KB |
200000 token(s): yes count is 94603, no count is 105397 |
5 |
Correct |
579 ms |
3840 KB |
200000 token(s): yes count is 94148, no count is 105852 |
6 |
Correct |
631 ms |
10164 KB |
200000 token(s): yes count is 97163, no count is 102837 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
15 ms |
348 KB |
expected NO, found YES [17th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2093 ms |
11536 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |