解题思路:
后续添加
注意事项:
后续添加
参考代码:
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 人评分
C语言网提供由在职研发工程师或ACM蓝桥杯竞赛优秀选手录制的视频教程,并配有习题和答疑,点击了解:
一点编程也不会写的:零基础C语言学练课程
解决困扰你多年的C语言疑难杂症特性的C语言进阶课程
从零到写出一个爬虫的Python编程课程
只会语法写不出代码?手把手带你写100个编程真题的编程百练课程
信息学奥赛或C++选手的 必学C++课程
蓝桥杯ACM、信息学奥赛的必学课程:算法竞赛课入门课程
手把手讲解近五年真题的蓝桥杯辅导课程
发表评论 取消回复