2016 Bluebridge cut_stamps

来源:互联网 发布:在线翻译软件 编辑:程序博客网 时间:2024/06/08 14:07

剪邮票


如【图1.jpg】, 有12张连在一起的12生肖的邮票。
现在你要从中剪下5张来,要求必须是连着的。
(仅仅连接一个角不算相连)
比如,【图2.jpg】,【图3.jpg】中,粉红色所示部分就是合格的剪取。

请你计算,一共有多少种不同的剪取方法。


I'm tring to write my blog in english to prove my english ability.If yout found angthing was wrong please help me to correct it.Cheers!

————————————————————————————————————————————————————————————————————————————

In this case , I  listed all the combinations of digit. And testing if the combination is valid. The problem is not hard.



Tips:

1. treat the form like 1,2,3,4,6,7,8,9,11,12,13,14 but not 1,2,3,4,5,6,7,8,9,10,11,12. It can avoid the some cases while we testing the combination. Like 4 plus 1 then boom there is a 5, but this case isn't valid to the problem.

2.In funtions which have return value you must put a "return" in it or the program will return a random digit.


0 0
原创粉丝点击