解题思路:
后续添加
注意事项:
后续添加
参考代码:
def f(m1, n1):
if m1 == 0:
return 1
sum_m = 1
for n_f in range(n1-m1+1, n1+1):
sum_m *= n_f
for m_f in range(1, m1+1):
sum_m /= m_f
return int(sum_m)
results = []
while True:
try:
n = int(input())
except:
break
else:
over_number = 0
min_pit = n // 3
for pit_number in range(min_pit, n):
min_double_nm = max(0, n - 2 * pit_number - 1)
max_double_nm = (n - pit_number) // 2
for double_nm_number in range(min_double_nm, max_double_nm+1):
over_number += f(double_nm_number, pit_number+1) * f(n-pit_number-2*double_nm_number, pit_number+1-double_nm_number)
results.append(over_number+1)
for result in results:
print(result)
0.0分
0 人评分
人见人爱A+B (C语言代码)浏览:663 |
printf基础练习2 (C语言代码)浏览:826 |
简单的a+b (C语言代码)浏览:385 |
C语言训练-列出最简真分数序列* (C语言代码)浏览:658 |
蛇行矩阵 (C语言代码)浏览:606 |
A+B for Input-Output Practice (V) (C语言代码)浏览:497 |
【亲和数】 (C语言代码)浏览:628 |
C二级辅导-等差数列 (C语言代码)浏览:806 |
C二级辅导-统计字符 (C语言代码)浏览:514 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:710 |