#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,set<int>>mp;
for (int i = 0; i < n; i++)
{
int a, b ; cin >> a >> b;
mp[a].insert(b) ;
}
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;
sy = *mp[sx].lower_bound(sy) ;
for(int j = sx ; j < ex ; j ++ ){
auto itt = mp[j].lower_bound(sy) ;
if(itt==mp[j].end()) {ok=1; break ; }
sy = *itt ;
}
v.pb(ey);
if(ey >= sy && ok == 0 )cout<<"Yes\n"; else cout<<"No\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
856 KB |
expected NO, found YES [27th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
175 ms |
9808 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
180 ms |
9808 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
371 ms |
9808 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Incorrect |
561 ms |
9864 KB |
expected NO, found YES [1000th token] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
660 ms |
10576 KB |
expected NO, found YES [5147th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
688 KB |
expected NO, found YES [17th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2060 ms |
17156 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |