02 2014 档案

摘要:A centipede has 40 left feet and 40 right feet. It keepsaleft slippers andbright slippers under its bed. Every morning the centipede puts on the slippers. It pokes its first left foot under the bed and puts on a random slipper, doing it in one second. If the slipper is left, the centipede passes to 阅读全文
posted @ 2014-02-23 23:11 Oyking 阅读(481) 评论(0) 推荐(0)
摘要:In the present world you frequently meet a lot of call numbers and they are going to be longer and longer. You need to remember such a kind of numbers. One method to do it in an easy way is to assign letters to digits as shown in the following picture:1 ij 2 abc 3 def4 gh 5 kl 6 mn7 prs ... 阅读全文
posted @ 2014-02-22 22:10 Oyking 阅读(1586) 评论(0) 推荐(0)
摘要:The problem is so easy, that the authors were lazy to write a statement for it!InputThe input stream contains aset ofinteger numbersAi(0≤Ai≤ 10^18). The numbers are separated byany number ofspaces and line breaks. Asize ofthe input stream does not exceed 256KB.OutputFor each numberAifrom the last on 阅读全文
posted @ 2014-02-22 20:47 Oyking 阅读(457) 评论(0) 推荐(0)
摘要:DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as foll... 阅读全文
posted @ 2014-02-12 23:13 Oyking 阅读(234) 评论(0) 推荐(0)
摘要:DescriptionBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n _ 2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long LL; 7 8 const int MAXN = 25; 9 10 int n, m = 3;11 bool vis[MAXN];12 13 LL power(LL x, int p) {14 LL ret =... 阅读全文
posted @ 2014-02-09 21:40 Oyking 阅读(470) 评论(0) 推荐(0)
摘要:Let's imagine how apple tree looks in binary computer world. You're right, it looks just like a binary tree, i.e. any biparous branch splits up to exactly two new branches. We will enumerate by integers the root of binary apple tree, points of branching and the ends of twigs. This way we may 阅读全文
posted @ 2014-02-05 19:48 Oyking 阅读(415) 评论(0) 推荐(0)
摘要:You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your island. You immedietaly send for the Bytelandian Cryptographer, but he is currently busy eating popcorn and claims that he may only decrypt the most i 阅读全文
posted @ 2014-02-04 15:08 Oyking 阅读(418) 评论(0) 推荐(0)
摘要:DescriptionYou may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resemblance; these typically have geometric or amorphous shapes like cubes, oil slicks or clouds o 阅读全文
posted @ 2014-02-03 22:50 Oyking 阅读(246) 评论(0) 推荐(0)
摘要:DescriptionA substring of a stringTis defined as:T(i,k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|.Given two stringsA,Band one integerK, we defineS, a set of triples (i,j,k):S= {(i,j,k) |k≥K,A(i,k)=B(j,k)}.You are to give the value of |S| for specificA,BandK.InputThe input file contains several blocks of data. 阅读全文
posted @ 2014-02-02 00:14 Oyking 阅读(753) 评论(0) 推荐(0)
摘要:DescriptionThe repetition number of a string is defined as the maximum numberRsuch that the string can be partitioned intoRsame consecutive substrings. For example, the repetition number of "ababab" is 3 and "ababa" is 1.Given a string containing lowercase letters, you are to fin 阅读全文
posted @ 2014-02-01 20:41 Oyking 阅读(287) 评论(0) 推荐(0)