AcWing 4510. 寻宝!大冒险!
原题链接
简单
作者:
孤星入梦
,
2024-12-01 13:52:07
,
所有人可见
,
阅读 4
(暴力)
keep it simple, stupid
Python3 代码
n, L, S = map(int, input().split())
tree = set()
for _ in range(n):
x, y = map(int, input().split())
tree.add((x,y))
B =[]
for _ in range(S+1):
row = list(map(int, input().split()))
B.append(row)
count =0
for x, y in tree:
match = True
for i in range(S+1):
for j in range(S+1):
if x+i > L or y +j > L:
match = False
break
if B[S -i][j] == 1 and (x+i, y+j) not in tree:
match = False
break
if B[S - i][j] == 0 and (x + i, y + j) in tree:
match = False
break
if not match:
break
if match:
count +=1
print(count)