摘要: 题意:Description某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二... 阅读全文
posted @ 2015-07-24 23:11 白一 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 题意:Two bored soldiers are playing card war. Their card deck consists of exactlyncards, numbered from1ton,all values are different. They divide cards b... 阅读全文
posted @ 2015-07-24 22:59 白一 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 题意: You are given a string consisting of parentheses()and[]. A string of this type is said to becorrect:(a)if it is the empty string(b)if A and B are ... 阅读全文
posted @ 2015-07-24 21:28 白一 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题意: You are to find all the two-word compound words in a dictionary. A two-word compound word is aword in the dictionary that is the concatenation of ... 阅读全文
posted @ 2015-07-24 20:40 白一 阅读(650) 评论(0) 推荐(0) 编辑
摘要: 题意: Given is an ordered deck of n cards numbered 1to n with card 1 at the top and card n at thebottom.The following operation is performed aslong as t... 阅读全文
posted @ 2015-07-24 20:17 白一 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 题意: 对于一个n元组(a1,a2,……an),可以对于每个数求出它和下一个数的差的绝对值,得到一个新的n元组(|a1-a2|,|a2-a3|,……|an-a1|)。重复这个过程,得到的序列称为Ducci序列,例如:(8,11,2,7)—>(3,9,5,1)-->(6,4,4,2)-->(2,0,2... 阅读全文
posted @ 2015-07-24 19:54 白一 阅读(641) 评论(0) 推荐(0) 编辑