201409-1 相邻数对
n=int(input())
data = list(map(int,input().split()))
data.sort()
result=[]
for i in range(1,n):
if data[i]-data[i-1]==1:
result.append((data[i-1],data[i]))
print(len(result))
201409-2 画图
一次做对!开心
n=int(input())
data =[]
for i in range(n):
data.append([])
data[i]=list(map(int,input().split()))
rec = [[0]*100 for _ in range(100)]
for i in data:
x1,y1,x2,y2=i[0],i[1],i[2],i[3]
for x in range(x1,x2):
for y in range(y1,y2):
rec[x][y]+=1
sum_=0
for i in rec:
zero = i.count(0)
rest = 100-zero
sum_+=rest
print(sum_)