求助

题目总版

KiLi_666 @ 2024-11-23 22:45:39

n = int(input()) dp = [[0 for in range(100)] for in range(100)]

for i in range(n):

a, b, g, k = map(int, input().split())
# 优化:只更新需要更新的区域
for x in range(a, g + 1):
    dp[x][b:k + 1] = [dp[x][y] + 1 for y in range(b, k + 1)]

you, ni = map(int, input().split())

if dp[you][ni]!= 0:

print(dp[you][ni])

else:

print(-1)

全部re了,还有救吗


|