原題: Along a circular track, there are N gas stations, which are numbered clockwise from 1 up to N. At station i, there are p i gallons of petrol available. To race from station i to its clockwise neighbor one need q i gallons of petrol. Consider
原題: E. Swapping Characters time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output We had a string s consisting of n lowercase Latin letters. We made k copies of this string, thus obtaining k
原題: Let the sum of the square of the digits of a positive integer S 0 be represented by S 1 . In a similar way, let the sum of the squares of the digits of S 1 be represented by S 2 and so on. If S i = 1 for some i ≥ 1, then the original integer S 0
原題: Walking on the Safe Side Square City is a very easy place for people to walk around. The two-way streets run North-South or East-West dividing the city into regular blocks. Most street intersections are safe for pedestrians to cross. In some
刷博弈前請看:http://blog.csdn.net/liuqiyao_01/article/details/8479340 HDOJ1079&POJ1082&ZOJ1024Calendar Game [找規律博弈] HDOJ1525&POJ2348Euclid's Game HDOJ1564Play a game HDOJ 1846 Brave Game HDOJ1847GoodLuck in CET-4 Everybody! HDOJ2147
原題: You have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we will not discuss in detail how the strings are generated and
原題: The poor man went to the King and said, “Lord, I cannot maintain my family. Please give me some wealth so that I can survive with my wife and children.” The King replied, “I shall grant you a piece of land so that you can cultivate and grow