当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1351:Number of Locks

题目描述
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.
输入解释
There is one given data n (number of slots) on every line. At the end of all the input data is -1, which means the end of input.
输出解释
According to the input data, count the number of locks. Each output occupies one line. Its fore part is a repetition of the input data and then followed by a colon and a space. The last part of it is the number of the locks counted.
输入样例
2
3
-1
输出样例
2: 0
3: 8

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Xi'an 2002

源链接: POJ-1351

最后修改于 2020-10-29T06:01:46+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000