Time Limit: 2 Seconds Memory Limit: 65536 KBIn 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
Time Limit: 2 Seconds Memory Limit: 65536 KBA 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 0
Time Limit: 2 Seconds Memory Limit: 65536 KBYou 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
Time Limit: 2 Seconds Memory Limit: 65536 KBContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will
文章目錄 Input SpecificationOutput SpecificationSample InputSample Output ZOJ Problem Set - 1088System OverloadTime Limit: 10 Seconds Memory Limit: 32768 KBRecently you must have experienced that when too many people use
Time Limit: 2 Seconds Memory Limit: 65536 KBBill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill has a working stopwatch, so they can record their
Time Limit: 2 Seconds Memory Limit: 65536 KBStatement of the ProblemWe say that a number is a palindrom if it is the sane when read from left to right or from right to left. For example, the number 75457 is a palindrom.Of course, the property
Time Limit: 2 Seconds Memory Limit: 65536 KBZombies 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
Time Limit: 2 Seconds Memory Limit: 65536 KBFind and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and also
Time Limit: 2 Seconds Memory Limit: 65536 KBThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2)Input Input consists of a sequence of lines, each containing an integer n. (n < 1,000,000)Output
Time Limit: 2 Seconds Memory Limit: 65536 KBA large field has a dog and a gopher. The dog wants to eat the gopher, while the gopher wants to run to safety through one of several gopher holes dug in the surface of the field. Neither the dog nor
int max(int a, int b){return a > b ? a:b;}void main(){int (*fp)(int,int);int (*fp2)(int,int);fp = max;fp2 = &max;int a = 1, b = 2, c = 3;cout << "The biggest int three num is: " << (*fp)(fp(a, b), c) << endl;cout <<
利用位元影像排序問題:一個最多包含n個正整數的檔案,每個數都小於n,n = 1000 0000。檔案中的正整數沒有重複的,請按升序排列這些整數。可用記憶體空間只有1MB左右,已耗用時間在10秒左右。 解決方案:使用一個具有1000萬個位的為序列表示這個檔案中的所有整數。若且唯若整數 i 在檔案中時,第 i 位為1。用C++具體實現的話,可用使用位域bitset來實現。bitset<10000000>