Submission #1231746

#TimeUsernameProblemLanguageResultExecution timeMemory
1231746AishaTrampoline (info1cup20_trampoline)C++20
43 / 100
2096 ms16092 KiB
#include "bits/stdc++.h"

using namespace std;

#define int long long

signed main() {
    int r, c, n;
    cin >> r >> c >> n;

    vector <int> a(n);
    vector <int> b(n);

    for (int i = 0; i < n; i ++) cin >> a[i] >> b[i];
    set <pair <int, int>> st;
    for (int i = 0; i < n; i ++) st.insert({a[i], b[i]});

    int t;
    cin >> t;

    while (t --) {
        int sx, sy, ex, ey;
        cin >> sx >> sy >> ex >> ey;

        int x = sx, y = sy;
        while (x < ex) {
            while (st.find({x, y}) == st.end() && y < c) {
                y ++;
            }
            if (st.find({x, y}) != st.end()) x ++;
            else break;
        }
        
        if (x == ex && y <= ey) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...