题解
2025-07-05 19:00:18
发布于:浙江
2阅读
0回复
0点赞
from collections import deque
n = int(input())
carpets = deque()
for i in range(n):
a, b, g, k = map(int, input().split())
carpets.append((a, b, a + g, b + k, i + 1))
x, y = map(int, input().split())
result = -1
while carpets:
a, b, right, top, idx = carpets.pop()
if a <= x <= right and b <= y <= top:
result = idx
break
print(result)
这里空空如也
有帮助,赞一个