50分
查看原帖
50分
1234611
peter13701216051楼主2024/7/16 10:52

#include #include using namespace std;

int main() { int n, m, x, y; cin >> n >> m >> x >> y;

vector<vector<int>> bombed(n, vector<int>(m, 0));

for (int i = 0; i < x; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    for (int j = x1; j <= x2; j++) {
        for (int k = y1; k <= y2; k++) {
            bombed[j - 1][k - 1]++;
        }
    }
}

for (int i = 0; i < y; i++) {
    int px, py;
    cin >> px >> py;
    if (bombed[px - 1][py - 1] > 0) {
        cout << "Y " << bombed[px - 1][py - 1] << " " << x << endl;
    } else {
        cout << "N" << endl;
    }
}

return 0;

}

2024/7/16 10:52
加载中...