Files
python/LuoGu/RuMen/P1847.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

24 lines
851 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <bits/stdc++.h>
using namespace std;
long long tot, ans, n, m;//tot是累计ans是最后一次
int main() {
cin >> m >> n;
long long a[n + 1], b[n + 1], x[n + 1], y[n + 1], i, j;//轰炸坐标定位ij为关键点的坐标
for (int k = 1; k <= m; k++)
cin >> a[k] >> b[k] >> x[k] >> y[k]; //读入
for (int o = 1; o <= n; o++) {
cin >> i >> j;//关键点
for (int k = 1; k <= m; k++)
if (i >= a[k] && i <= x[k] && j >= b[k] && j <= y[k])//如果在这个范围内
{
tot++;//累计
ans = k;//覆盖
}
if (tot == 0)cout << "NO" << endl;
else cout << "YES" << " " << tot << " " << ans << endl;//如果累计为1 NO,反之
tot = 0;//因为要下一轮所以计数器清零
}
}