Submission #920971

# Submission time Handle Problem Language Result Execution time Memory
920971 2024-02-03T08:32:18 Z itslq Trampoline (info1cup20_trampoline) C++17
0 / 100
176 ms 8008 KB
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    bool can;
    int R, C, T, N, x, y, a, b;
    cin >> R >> C >> N;

    unordered_map<int, vector<int>> green;

    while (N--) {
        cin >> x >> y;
        green[x].push_back(y);
    }

    for (pair<int, vector<int>> row: green) sort(row.second.begin(), row.second.end());

    cin >> T;

    while (T--) {
        can = 1;
        cin >> x >> y >> a >> b;

        if (a < x || b < y) {
            cout << "No\n";
            continue;
        }

        for (; x < a; x++) {
            if (green.find(x) == green.end()) {
                can = 0;
                cout << "No\n";
                break;
            }

            auto it = lower_bound(green[x].begin(), green[x].end(), y);
            if (it == green[x].end()) {
                can = 0;
                cout << "No\n";
                break;
            } else if ((y = *it) > b) {
                can = 0;
                cout << "No\n";
                break;
            }
        }

        if (can) {
            cout << "Yes\n";
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 2084 KB expected YES, found NO [3rd token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 116 ms 2180 KB expected YES, found NO [4th token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 176 ms 8008 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -