Submission #1145021

#TimeUsernameProblemLanguageResultExecution timeMemory
1145021dobri_okeTrampoline (info1cup20_trampoline)C++20
43 / 100
2118 ms696944 KiB
#pragma GCC target ("avx2")   
#pragma GCC optimize ("Ofast")   
#include <bits/stdc++.h>   
using namespace std;  
#define int long long  
#define F first 
#define S second 
#define pb push_back 
const int N = 1e6, NN=26;
const int mod=1e9+7;
//int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); }
//int lcm(int a, int b) { return a / gcd(a, b) * b; }
//int binpow(int a,int b){if(!b)return 1; if(b&1)return a*binpow(a,b-1)%mod; int x=binpow(a,b/2); return x*x%mod;}
signed main(){   
    ios_base::sync_with_stdio(0);   
    cin.tie(0);   
    cout.tie(0);
    int r, c, n;
    cin >> r >> c >> n;
    map < pair < int, int >, bool > mp;
    for(int i=1;i<=n;i++){
        int a, b;
        cin >> a >> b;
        mp[{a, b}]=1;
    }
    int t;
    cin >> t;
    while(t--){
        int xs, ys, xe, ye;
        cin >> xs >> ys >> xe >> ye;
        while(xs<xe || ys<ye){
            if(xs>xe || ys>ye) break;
            if(mp[{xs, ys}]==0){
                ys++;
            }
            else{
                if(xs<xe) xs++;
                else ys++;
            }
        }
        if(xs==xe && ys==ye) cout << "Yes\n";
        else cout << "No\n";
    }
}
#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...