0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:31:59 +00:00

P1830 轰炸III

R52219097
This commit is contained in:
Baoshuo Ren 2021-06-30 17:34:00 +08:00 committed by Baoshuo Ren
parent f19172d756
commit a47b17b9fd
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,28 @@
#include <bits/stdc++.h>
using namespace std;
pair<int, int> boom[105][105];
int main() {
int n, m, x, y, x1, y1, x2, y2;
cin >> n >> m >> x >> y;
for (int i = 1; i <= x; i++) {
cin >> x1 >> y1 >> x2 >> y2;
for (int j = x1; j <= x2; j++) {
for (int k = y1; k <= y2; k++) {
boom[j][k].first++;
boom[j][k].second = i;
}
}
}
for (int i = 1; i <= y; i++) {
cin >> x1 >> y1;
if (boom[x1][y1].first) {
cout << "Y " << boom[x1][y1].first << ' ' << boom[x1][y1].second << endl;
} else {
cout << "N" << endl;
}
}
return 0;
}