生成函数入门题。
对每个物品分别列一下,化到最后是x(1−x)4
根据广义二项式定理,最后答案是C4−1(N−1)+4−1=C3n+2
N = int(input())
print(int((N + 1) * (N + 2) * N / 6) % 10007)
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有