题解 | #走方格的方案数#
走方格的方案数
http://www.nowcoder.com/practice/e2a22f0305eb4f2f9846e7d644dba09b
go = [lambda x1,y1:(x1+1,y1), lambda x1,y1:(x1,y1-1)] def func(x1,y1,x2,y2): global num if (x1,y1) == (x2,y2): num +=1 return if x1<=x2 and y1>=y2: for g in go: d = g(x1,y1) func(d[0],d[1],x2,y2) while 1: try: num = 0 lst = [int(i) for i in input().split()] func(0,0,lst[0],-lst[1]) print(num) except: break