计算n x m的棋盘格子的不同走法种类(不需要依次输出所有走法)
201301 JAVA 题目2-3级
http://www.nowcoder.com/questionTerminal/e2a22f0305eb4f2f9846e7d644dba09b
有重复元素的排列问题(横向格子重复n次,纵向格子重复m次),计算公式为:
def perm(n): dot = 1 for i in range(1,n+1): dot = dot * i return dot while True: try: [n,m] = list(map(int,input().split())) k = perm(m+n)/(perm(m)*perm(n)) print(int(k)) except: break