随笔分类 -  Online Judge

摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB It is said that 90% of frosh expect to be above average in their class. You are to provide a reality check. Input The first line of standard inpu... 阅读全文
posted @ 2012-03-16 16:18 Gavin Lipeng Ma 阅读(273) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer. This problem ... 阅读全文
posted @ 2012-03-16 16:08 Gavin Lipeng Ma 阅读(241) 评论(0) 推荐(0)
摘要:Time Limit: 10 Seconds Memory Limit: 32768 KB We all know that FatMouse doesn't speak English. But now he has to be prepared since our nation will join WTO soon. Thanks to Turing we have compu... 阅读全文
posted @ 2012-03-15 21:34 Gavin Lipeng Ma 阅读(268) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multiple test cases! ... 阅读全文
posted @ 2012-03-15 20:59 Gavin Lipeng Ma 阅读(983) 评论(0) 推荐(0)
摘要:Time Limit: 10 Seconds Memory Limit: 32768 KB In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n pl... 阅读全文
posted @ 2012-03-15 20:02 Gavin Lipeng Ma 阅读(266) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB Starting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1, 2, and 3 has be... 阅读全文
posted @ 2012-03-15 16:34 Gavin Lipeng Ma 阅读(353) 评论(0) 推荐(0)
摘要:Time Limit: 10 Seconds Memory Limit: 32768 KB For hundreds of years Fermat's Last Theorem, which stated simply that for n > 2 there exist no integers a, b, c > 1 such that a^n = b^n + c^n, has r... 阅读全文
posted @ 2012-03-13 17:19 Gavin Lipeng Ma 阅读(382) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. One night,... 阅读全文
posted @ 2012-03-13 13:03 Gavin Lipeng Ma 阅读(346) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KBGiven a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p.Example For n = 24, o = 3 and p = 3.Task Write a program which for each data set:reads a positive integer n, computes the odd integer o and the nonnegative in 阅读全文
posted @ 2012-03-13 10:18 Gavin Lipeng Ma 阅读(360) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB Given a positive integer n, print out the positions of all 1's in its binary representation. The position of the least significant bit is 0. Examp... 阅读全文
posted @ 2012-03-12 22:52 Gavin Lipeng Ma 阅读(370) 评论(0) 推荐(0)
摘要:Time Limit: 2 Seconds Memory Limit: 65536 KB You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or the film of the same name by Stanley Kubrick. In it a spaceship is ... 阅读全文
posted @ 2012-03-12 22:08 Gavin Lipeng Ma 阅读(362) 评论(0) 推荐(0)
摘要:Digital RootsTime Limit: 2 Seconds Memory Limit: 65536 KBBackground The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are 阅读全文
posted @ 2012-03-12 21:49 Gavin Lipeng Ma 阅读(983) 评论(0) 推荐(0)
摘要:Old BillTime Limit: 2 Seconds Memory Limit: 65536 KBAmong grandfather��s papers a bill was found:72 turkeys $_679_The first and the last digits of the number that obviously represented the total price of those turkeys are replaced here by blanks (denoted _), for they are faded and are now illegible. 阅读全文
posted @ 2012-03-12 20:31 Gavin Lipeng Ma 阅读(254) 评论(0) 推荐(0)
摘要:Time Limit: 1 Second Memory Limit: 32768 KB To prepare for programming contests or coding examinations, the judge sometimes has to generate random passwords for the users. The problem is tha... 阅读全文
posted @ 2011-09-27 21:46 Gavin Lipeng Ma 阅读(265) 评论(0) 推荐(0)
摘要:ConversionsTime Limit:1 Second Memory Limit:32768 KBConversion between the metric and English measurement systems is relatively simple. Often, it involves either multiplying or dividing by a constant. You must write a program that converts between the following units:TypeMetricEnglishequivalentWeigh 阅读全文
posted @ 2011-07-09 15:08 Gavin Lipeng Ma 阅读(438) 评论(0) 推荐(0)
摘要:Kinds of FuwasTime Limit:1 Second Memory Limit:32768 KBIn the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China as well as becoming a festival for people all over the world.The official mascots of Beijing 2008 Olympic Games are Fuwa, which are named 阅读全文
posted @ 2011-07-09 14:35 Gavin Lipeng Ma 阅读(615) 评论(0) 推荐(0)
摘要:Find All M^N PleaseTime Limit:1 Second Memory Limit:32768 KBRecently, Joey has special interest in the positive numbers that could be represented asM^N(Mto the powerN), whereMandNare both positive integers greater than or equal to 2. For example, 4, 8, 9 and 16 are first four such numbers, as 4 = 2 阅读全文
posted @ 2011-07-07 21:20 Gavin Lipeng Ma 阅读(462) 评论(0) 推荐(0)
摘要:Easy TaskTime Limit:1 Second Memory Limit:32768 KBCalculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivation. We use x^n to denote xn. To calculate the derivation of a polynomial, you should know 3 rules:(1) (C)'=0 where C is a 阅读全文
posted @ 2011-07-04 12:49 Gavin Lipeng Ma 阅读(644) 评论(0) 推荐(0)
摘要:ZOJ Problem Set - 2987MisspellingTime Limit:1 Second Memory Limit:32768 KBMisspelling is an art form that students seem to excel at. Write a program that removes thenth character from an input string.InputThe first line of input contains a single integerN, (1 <=N<= 1000) which is the number of 阅读全文
posted @ 2011-07-03 00:30 Gavin Lipeng Ma 阅读(440) 评论(0) 推荐(0)
摘要:ZOJ Problem Set - 2965Accurately Say "CocaCola"!Time Limit:1 Second Memory Limit:32768 KBIn a party held by CocaCola company, several students stand in a circle and play a game.One of them is selected as the first, and should say the number 1. Then they continue to count number from 1 one 阅读全文
posted @ 2011-07-02 22:45 Gavin Lipeng Ma 阅读(423) 评论(0) 推荐(0)