20191202 回收站选址 python
题目
代码
n = int(input())
r={}
count = [0]*5
for i in range(n):
sr = input().split()
r[sr[0]+','+sr[1]] = 1
for item in r:
flag = 0
point = 0
x,y = map(int,item.split(','))
if r.get(str(x-1)+','+str(y),0)==1 and r.get(str(x+1)+','+str(y),0)==1 and r.get(str(x)+','+str(y-1),0)==1 and r.get(str(x)+','+str(y+1),0)==1:
count[r.get(str(x-1)+','+str(y-1),0)+r.get(str(x+1)+','+str(y-1),0)+r.get(str(x-1)+','+str(y+1),0)+r.get(str(x+1)+','+str(y+1),0)]+=1
for i in count:
print(i)