[POJ 1351] Number of Locks

这道题目描述了一种弹簧锁的制造过程,每个锁有n个槽位,槽位高度可以是1、2、3或4。锁的设计要求至少有一对相邻槽位高度差为3,并且锁中必须有至少3种不同的高度。输入给出每个锁的槽位数n,任务是计算在满足条件的情况下,能制造出多少种不同的锁。样例输入包括2个槽位和3个槽位的情况,以及结束标志-1。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Number of Locks
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 1326 Accepted: 642

Description
In certain factory a kind of spring locks is manufactured. There are n slots (1 < n < 17, n is a natural number.) for each lock. The height of each slot may be any one of the 4 values in{1,2,3,4}( neglect unit ). Among the slots of a lock there are at least one pair of neighboring slots with their difference of height equal to 3 and also there are at least 3 different height values of the slots for a lock. If a batch of locks is manufactured by taking all over the 4 values for slot height and meet the two limitations above, find the number of the locks produced.

Input
There is one given data n (number of slots) on every

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

真·skysys

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值