이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <map>
#include <set>
//#include <fstream>
using namespace std;
//ifstream F("be.txt");
//ofstream Fo("ki.txt");
map<int, set<int> > m;
int N, R, C, T;
int main(){
cin >> R >> C >> N;
int x, y;
for(int i = 1; i <= N; ++i){
cin >> x >> y;
m[x].insert(y);
}
cin >> T;
int x1, y1;
while(T--){
bool flag = false;
cin >> x >> y >> x1 >> y1;
if(x > x1 || y > y1)
flag = false;
else if(x == x1)
flag = true;
else {
int i = x, t = y;
while(m.count(i) && i != x1){
auto it = m[i].lower_bound(t);
if(it == m[i].end()) break;
t = *it;
if(t > y1) break;
++i;
}
if(i == x1)
flag = true;
else
flag = false;
}
cout << (flag ? "Yes\n" : "No\n");
}
return 0;
}
| # | 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... |