python P3904 三只小猪 发表于 2019-06-08 | 分类于 python | 阅读次数: 题面题面所求即为第二类斯特林数 12345678910111213n, m = map(int, input().split(' '))a = [[0] * 55 for _ in range(55)]if(m > n): print(0)else: for i in range(1, n + 1): a[i][i] = a[i][1] = 1 for j in range(2, m + 1): for i in range(j + 1, n + 1): a[i][j] = a[i - 1][j - 1] + a[i - 1][j] * j print(a[n][m])