当前位置:网站首页>Hangzhou electric the competition team arrangement (ACM)
Hangzhou electric the competition team arrangement (ACM)
2022-08-04 14:35:00 【51CTO】
ACMTeam arrangement
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1039 Accepted Submission(s): 502
Problem Description
ACMThe Asian competition is over,It means that preparations for next year's Zhejiang University Student Programming Contest have begun! 杭州电子科技大学ACMThe training team is also ready to start forming teams. The coach wants to take it allnThe players form several teams,The principle is that each team has at least one person,最多三人. 现在问题来了:If the number of players in the training team is knownn,Please help the coach to figure out how many possible team formations there are. 特别说明: Teams are not numbered,即如果有A,B,C三人,{A}{BC}与{BC}{A}It's the same team situation.
Input
输入包含多组测试数据(约1000组),每组数据占一行,包含一个数字n(0<=n<=20),表示ACMThe number of players in the training team;n为0,表示输入结束.
Output
请输出nThe number of all possible team plans for a player,每组输出占一行.
Sample Input
1 2 3 4 5 0
Sample Output
1 2 5 14 46
思路:There was no idea at first,Did not expect it to be recursive,a[i]表示第isituation of a team
a[i] = a[i-1] + a[i-2] * C(i-1,1) + a[i-3] * C(i-1,2);
表示第iForm your own team+从i-1Choose one and the firstiIndividual team,The rest team up+从i-1个人里面选2个和第iIndividual team,The rest team up
AC代码:
边栏推荐
- 企业级优化
- Workaround without Project Facets
- 【剑指offer59】队列的最大值
- 【 HMS core 】 【 Media 】 online video editing service 】 【 material can't show, or network anomalies have been Loading state
- 期货开户之前要谈好最低手续费和交返
- ASA归因:如何评估关键词的投放价值
- FRED应用:毛细管电泳系统
- AOSP built-in APP franchise rights white list
- oracle+RAC+linux5.1所需要安装的包
- 浙江大学团队使用基于知识图谱的新方法,从空间分辨转录组数据中推断细胞间通信状况
猜你喜欢
随机推荐
Oracle RAC环境下vip/public/private IP的区别
技术分享| 融合调度系统中的电子围栏功能说明
Phasecraft连下两城,助力英国量子技术商业化加速!
16、学习MySQL 正则表达式
开发者独立搭建一个跨模态搜索应用有多难?
九州云出席领航者线上论坛,共话5G MEC边缘计算现状、挑战和未来
自监督学习未来是掩码自编码器?KAIST最新《自监督学习掩码自编码器》研究进展
用了TCP协议,就一定不会丢包吗?
职场漫谈:为什么越是内卷的行业越有人争着抢着往里冲?好奇怪的说...
编程思想_编程有必要给孩子学吗?
集合划分差最小问题(01背包)
vim common operation commands
CF1527D MEX Tree(mex&树&容斥)
关于redis的几件小事(五)redis保证高并发以及高可用
[深入研究4G/5G/6G专题-50]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-10-高可靠性技术-1-低编码率编码调制方案MCS与高可靠性DRB
RS|哨兵二号(.SAFE格式)转tif格式
FRED应用:毛细管电泳系统
Win11勒索软件防护怎么打开?Win11安全中心勒索软件防护如何设置
B. Construct a simple sequence (greedy)
四平方和,激光炸弹