Submission #637342

# Submission time Handle Problem Language Result Execution time Memory
637342 2022-09-01T12:24:56 Z kideso Trampoline (info1cup20_trampoline) C++17
73 / 100
2000 ms 28304 KB
#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
1 Correct 7 ms 724 KB 200 token(s): yes count is 21, no count is 179
2 Correct 7 ms 852 KB 200 token(s): yes count is 70, no count is 130
3 Correct 6 ms 692 KB 197 token(s): yes count is 25, no count is 172
# Verdict Execution time Memory Grader output
1 Correct 218 ms 11796 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 243 ms 11820 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 574 ms 11252 KB 4000 token(s): yes count is 4000, no count is 0
4 Correct 632 ms 11776 KB 4000 token(s): yes count is 1991, no count is 2009
# Verdict Execution time Memory Grader output
1 Correct 860 ms 22080 KB 200000 token(s): yes count is 110486, no count is 89514
2 Correct 871 ms 22060 KB 200000 token(s): yes count is 114664, no count is 85336
3 Correct 873 ms 22084 KB 200000 token(s): yes count is 86232, no count is 113768
4 Correct 975 ms 22392 KB 200000 token(s): yes count is 94603, no count is 105397
5 Correct 903 ms 22308 KB 200000 token(s): yes count is 94148, no count is 105852
6 Correct 981 ms 28304 KB 200000 token(s): yes count is 97163, no count is 102837
# Verdict Execution time Memory Grader output
1 Correct 19 ms 852 KB 5000 token(s): yes count is 3238, no count is 1762
2 Correct 24 ms 860 KB 5000 token(s): yes count is 3837, no count is 1163
3 Correct 20 ms 1312 KB 5000 token(s): yes count is 4104, no count is 896
4 Correct 27 ms 844 KB 5000 token(s): yes count is 3934, no count is 1066
5 Correct 309 ms 968 KB 5000 token(s): yes count is 3384, no count is 1616
6 Correct 19 ms 724 KB 5000 token(s): yes count is 3390, no count is 1610
# Verdict Execution time Memory Grader output
1 Execution timed out 2085 ms 21176 KB Time limit exceeded
2 Halted 0 ms 0 KB -