Problem DescriptionAs you know, Gardon trid hard for his love-letter, and now he's spending too much time on choosing flowers for Angel.When Gardon entered the flower shop, he was frightened and dazed by thousands kinds of flowers. "How can I choose!
Problem DescriptionTo improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware that the cows interpret some serial numbers
Problem DescriptionA bit string has odd parity if the number of 1's is odd. A bit string has even parity if the number of 1's is even.Zero is considered to be an even number, so a bit string with no 1's has even parity. Note that the number of0's
DescriptionYou 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
DescriptionA boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property:1 0 1 00 0 0 01 1 1 10 1 0 1The sums of the
DescriptionThere are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university believe in.You know that there are n
DescriptionZombies love to eat brains. Yum.InputThe first line contains a single integer n indicating the number of data sets.The following n lines each represent a data set. Each data set will be formatted according to the following description:A
轉自http://hi.baidu.com/qwpsmile/blog/item/9bc44efa4f41018a9f514637.html+----------------+| strtol |+----------------+i.e. string to longlong int strtol(const char *nptr, char **endptr, int base)strtol()會將nptr指向的字串,根據參數base,按權轉化為long
Problem Description讀入兩個小於100的正整數A和B,計算A+B.需要注意的是:A和B的每一位元字由對應的英文單詞給出. Input測試輸入包含若干測試案例,每個測試案例佔一行,格式為"A + B =",相鄰兩字串有一個空格間隔.當A和B同時為0時輸入結束,相應的結果不要輸出. Output對每個測試案例輸出1行,即A+B的值. Sample Inputone + two =three four + five six =zero seven + eight nine
Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais tout s’affirmait faux. Tout avait Fair
Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Inputeach test case contains two numbers A and B. Outputfor each case, if A is equal to B, you should print "YES", or print "NO". Sample
Problem Description輕鬆通過墓碑,進入古墓後,才發現裡面別有洞天。突然,Yifenfei發現自己周圍是黑壓壓的一群蝙蝠,個個扇動翅膀正準備一起向他發起進攻!形勢十分危急!好在此時的yifenfei已經不是以前那個經常被lemon搶走MM的菜鳥了!面對眾多蝙蝠的嗜血狂攻,只見yifenfei使出輕靈的劍法,刷,刷,刷,瞬間搞定……現已知yifenfei使用了2招(劍招A和劍招B):劍招A,一招能殺死一半的蝙蝠。但是如果當前的蝙蝠數為奇數,那麼就必須先出一招劍招B殺死其中任意一個,
Problem Description"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to tell me which integer is the
DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every even number greater than 4 can be written as the sum of two odd prime numbers. For example: 8 = 3
DescriptionComputing the exact number of ways that N things can be taken M at a time can be a great challenge when N and/or M become very large. Challenges are the stuff of contests. Therefore, you are to make just such a computation given the