Submission #921011

# Submission time Handle Problem Language Result Execution time Memory
921011 2024-02-03T08:55:08 Z Sandarach151 Trampoline (info1cup20_trampoline) C++17
0 / 100
2000 ms 9912 KB
#include<bits/stdc++.h>
using namespace std;

int main(){
    int r, c, t;
    cin >> r >> c >> t;
    map<int, vector<int> > mp;
    for(int i=0; i<t; i++){
        int a, b;
        cin >> a >> b;
        if(!mp.count(a)){
            vector<int> temp;
            mp[a] = temp;
        }
        mp[a].push_back(b);
    }
    for(auto u : mp){
        sort(u.second.begin(), u.second.end());
    }
    // for(auto u : mp){
    //     if(mp.count(u.first+1)==0){
    //         continue;
    //     }
    //     auto temp = mp[u.first+1];
    //     for(auto x : u.second){
    //         x.second = lower_bound(temp.begin(), temp.end(), x.first)->first;
    //     }
    // }
    int q;
    cin >> q;
    while(q--){
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        while(a<c && b<=d){
            vector<int> temp = mp[a];
            auto it = lower_bound(temp.begin(), temp.end(), b);
            if(it==temp.end()){
                break;
            }
            else{
                b = *it;
                a++;
            }
            // cout << a << ", " << b << "\n";
        }
        if(b<=d && a==c) cout << "Yes\n";
        else cout << "No\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 348 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 108 ms 1904 KB expected YES, found NO [3rd token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 3240 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 344 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 933 ms 9912 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -