摘要: DescriptionBob has traveled to byteland, he find the N cities in byteland formed a tree structure, a tree structure is very special structure, there is exactly one path connecting each pair of nodes, and a tree with N nodes has N - 1 edges.As a traveler, Bob wants to journey between those N cities, 阅读全文
posted @ 2013-07-28 00:02 Oyking 阅读(526) 评论(0) 推荐(0) 编辑
摘要: DescriptionWrite a program to transform the permutation1, 2, 3,...,naccording tominstructions. Each instruction(a,b)means to take out the subsequence from thea-th to theb-th element, reverse it, then append it to the end.InputThere is only one case for this problem. The first line contains two integ 阅读全文
posted @ 2013-07-27 18:27 Oyking 阅读(419) 评论(0) 推荐(0) 编辑
摘要: DescriptionYou are given an undirected graph with N vertexes and M edges. Every vertex in this graph has an integer value assigned to it at the beginning. You're also given a sequence of operations and you need to process them as requested. Here's a list of the possible operations that you m 阅读全文
posted @ 2013-07-26 23:14 Oyking 阅读(389) 评论(0) 推荐(0) 编辑
摘要: DescriptionOnce upon a time, in a faraway land, there lived a king. This king owned a small collection of rare and valuable trees, which had been gathered by his ancestors on their travels. To protect his trees from thieves, the king ordered that a high fence be built around them. His wizard was put 阅读全文
posted @ 2013-07-23 12:55 Oyking 阅读(315) 评论(0) 推荐(0) 编辑
摘要: DescriptionDuring a voyage of the starship Hakodate-maru (see Problem 1406), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of "super stars". Do not take this term as a description of actors or singers. It is a revo 阅读全文
posted @ 2013-07-22 18:17 Oyking 阅读(598) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionOpen Source Tools help earthquake researchers stay a step ahead. Many geological research facilities around the world use or are in... 阅读全文
posted @ 2013-07-21 23:44 Oyking 阅读(352) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionEach person had do something foolish along with his or her growth.But,when he or she did this that time,they could not predict that this thing is a mistake and they will want this thing would rather not happened.The world king Sconbin is not the exception.One day,Sconbin was sleep 阅读全文
posted @ 2013-07-21 22:50 Oyking 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionWhile studying the history of royal families, you want to know how wealthy each family is. While you have various 'net worth' figures for each individual throughout history, this is complicated by double counting caused by inheritance. One way to estimate the wealth of a f 阅读全文
posted @ 2013-07-18 23:39 Oyking 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Petya loves volleyball very much. One day he was running late for a volleyball match. Petya hasn't bought his own car yet, that's why he had to take a taxi. The city hasnjunctions, some of which are connected by two-way roads. The length of each road is defined by some positive integer numbe 阅读全文
posted @ 2013-07-18 23:12 Oyking 阅读(475) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircl... 阅读全文
posted @ 2013-07-18 18:39 Oyking 阅读(270) 评论(0) 推荐(0) 编辑