摘要: DescriptionTwo bored soldiers are playing card war. Their card deck consists of exactlyncards, numbered from1ton,all values are different. They divide... 阅读全文
posted @ 2015-07-22 14:37 简约。 阅读(115) 评论(0) 推荐(0) 编辑
摘要: We say a sequence of characters is a palindrome if it is the same written forwards and backwards. For example, ‘racecar’ is a palindrome, but ‘fastcar... 阅读全文
posted @ 2015-11-03 20:27 简约。 阅读(132) 评论(0) 推荐(0) 编辑
摘要: A sequence of N positive integers (10 b[j]-s)continue; while(b[i]<=b[j]-s)i++; ans=min(ans,j-i+1); } printf("%d\n"... 阅读全文
posted @ 2015-10-31 10:20 简约。 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Alice got a hold of an old calculator that can display n digits. She was bored enough to come up with the following time waster.She enters a number k ... 阅读全文
posted @ 2015-10-31 10:16 简约。 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in whi... 阅读全文
posted @ 2015-10-31 10:06 简约。 阅读(149) 评论(0) 推荐(0) 编辑
摘要: In a city there are n bus drivers. Also there are n morning bus routes and n afternoon bus routes withvarious lengths. Each driver is assigned one mor... 阅读全文
posted @ 2015-10-09 21:40 简约。 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Here is a famous story in Chinese history.That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse... 阅读全文
posted @ 2015-10-09 20:53 简约。 阅读(270) 评论(0) 推荐(0) 编辑
摘要: A number of students are members ofa club that travels annually to exoticlocations. Their destinations in thepast have included Indianapolis, Phoenix,... 阅读全文
posted @ 2015-10-09 19:55 简约。 阅读(213) 评论(0) 推荐(0) 编辑
摘要: We would like to place n rooks, 1 ≤ n ≤ 5000, on a n × nboard subject to the following restrictions• The i-th rook can only be placed within the recta... 阅读全文
posted @ 2015-10-09 14:44 简约。 阅读(230) 评论(0) 推荐(0) 编辑
摘要: There are lots of number games for children. These games are pretty easy to play but not so easy to make. We will discuss about an interesting game he... 阅读全文
posted @ 2015-10-08 20:10 简约。 阅读(150) 评论(0) 推荐(0) 编辑
摘要: DescriptionJohn Doe is a famous DJ and, therefore, has the problem of optimizing the placement of songs on his tapes. For a given tape and for each so... 阅读全文
posted @ 2015-09-29 18:18 简约。 阅读(180) 评论(0) 推荐(0) 编辑