Submission #365970

# Submission time Handle Problem Language Result Execution time Memory
365970 2021-02-12T15:37:25 Z soba Trampoline (info1cup20_trampoline) C++14
0 / 100
1837 ms 14316 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
vector<ll>v[200001];
int main()
{
    ll r , c , n , x , y , a, b, t;
    cin >> r>> c >> n ;
    //cout << r << " " << c << " " << n << "\n";
    map<ll,ll>mp;
    //cout << "haha\n";
    ll cnt=1;
    for(int i = 0 ; i < n ; i++)
    {
        cin >> x>> y ;
        if(!mp[x])mp[x]=cnt++;
        v[mp[x]].push_back(y);
    }
    cin >> t;
    while(t--)
    {
        cin>> x >> y >> a >> b ;
        if(x==a)
        {
            if(y<=b)
            {
                cout << "Yes\n";
            }
            else cout << "No\n";
            continue;
        }
        int j=y;
        int impos=1;
        for(int i = x ; i<a ; i++)
        {
            if(mp[i]==0)
            {
                impos=1;
                break;
            }
            vector<ll>::iterator it = lower_bound(v[mp[i]].begin() , v[mp[i]].end() , j);
            if(it==v[mp[i]].end())
            {
            	j=c+1;
            }
            else j=*it;
            //cout << j << "\n";
            if(j>b)
            {
                impos=1;
                break;
            }
            if(i==a-1)
            {
                impos=0;
            }
        }
        if(impos)
        {
            cout << "No\n";
        }
        else cout << "Yes\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 5100 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 169 ms 8044 KB expected YES, found NO [3rd token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 969 ms 8288 KB expected YES, found NO [4th token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 5100 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1837 ms 14316 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -