摘要: Problem DescriptionXiaoA lives in a village. Last year flood rained the village. So they decide to move the whole village to the mountain nearby this year. There is no spring in the mountain, so each household could only dig a well or build a water line from other household. If the household decide 阅读全文
posted @ 2013-09-10 18:05 欧阳生朵 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionLittle John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessary omission. Luckily, he notice that there were N trees in the meadow numbered from 1 to N, and calculated their cartesian coordinates (Xi, Yi). To 阅读全文
posted @ 2013-09-09 20:57 欧阳生朵 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Problem Description(From wikipedia) For binary strings a and b the Hamming distance is equal to the number of ones in a XOR b. For calculating Hamming distance between two strings a and b, they must have equal length.Now given N different binary strings, please calculate the minimum Hamming distance 阅读全文
posted @ 2013-09-09 20:47 欧阳生朵 阅读(506) 评论(0) 推荐(0) 编辑
摘要: Description"Let it Bead" company is located upstairs at 700 Cannery Row in Monterey, CA. As you can deduce from the company name, their business is beads. Their PR department found out that customers are interested in buying colored bracelets. However, over 90 percent of the target audienc 阅读全文
posted @ 2013-07-19 10:15 欧阳生朵 阅读(284) 评论(0) 推荐(0) 编辑
摘要: DescriptionGiven two positive integersnandk, you are asked to generate a new integer, saym, by changing some (maybe none) digits ofn, such that the following properties holds:mcontains no leading zeros and has the same length asn(We considerzeroitself a one-digit integer without leading zeros.)mis d 阅读全文
posted @ 2013-07-18 09:01 欧阳生朵 阅读(277) 评论(0) 推荐(0) 编辑
摘要: DescriptionN cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid for the road (expressed in the number of coins).Bob and Alice used to live in the city 1. After noticing that Alice wa 阅读全文
posted @ 2013-06-11 21:18 欧阳生朵 阅读(230) 评论(0) 推荐(0) 编辑
摘要: DescriptionA network ofmroads connectsNcities (numbered from 1 toN). There may be more than one road connecting one city with another. Some of the roads are paid. There are two ways to pay for travel on a paid roadifrom cityaito citybi:in advance, in a cityci(which may or may not be the same asai);a 阅读全文
posted @ 2013-06-10 21:15 欧阳生朵 阅读(517) 评论(0) 推荐(0) 编辑
摘要: DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each repeater must be carefully chosen so that nearby repeaters do not interfere with one another. This condit 阅读全文
posted @ 2013-06-04 22:13 欧阳生朵 阅读(605) 评论(0) 推荐(0) 编辑
摘要: DescriptionSudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the empty cells with decimal digits from 1 to 9, o 阅读全文
posted @ 2013-06-04 19:28 欧阳生朵 阅读(163) 评论(0) 推荐(0) 编辑
摘要: DescriptionYou have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shred sheets of paper into little pieces so that the contents would become unreadable, this new shredder needs to have the following unusual basic char 阅读全文
posted @ 2013-06-03 22:13 欧阳生朵 阅读(364) 评论(1) 推荐(0) 编辑