"""
P1789 【Mc生存】插火把03(python3实现)
https://www.luogu.com.cn/problem/P1789
"""
import math
def pd(x,y):
if x<1 or y<1 or x>n or y>n:
return 0
else:
return 1
ans=0
s =[[0 for col in range(106)] for row in range(106)]
n,m,k=map( int,input().split() )
for i in range(1,m+k+1):
a, b = map(int, input().split())
for x in range(-2,3):
for y in range(-2,3):
if i>m or abs(x)+abs(y)<=2 and pd(x + a, b + y):
s[x+a][b+y]+=1
for i in range(1,n+1):
for j in range(1,n+1):
if s[i][j]==0:
ans+=1
print(ans)
P1789 【Mc生存】插火把(python3实现)
最新推荐文章于 2024-04-28 15:57:57 发布