原创 E - E.龍皇異次元 (POJ-3723)(最大生成樹)

Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and want

原创 Halloween treats (POJ-3370)(抽屜原理)

Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of swe

原创 Find a multiple (POJ-2356)(抽屜原理)

The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 1

原创 Complete the sequence! (POJ-1398)(差分法)

You probably know those quizzes in Sunday magazines: given the sequence 1, 2, 3, 4, 5, what is the next number? Sometim

原创 Chocolate (POJ-1322)(概率DP)

In 2100, ACM chocolate will be one of the favorite foods in the world. "Green, orange, brown, red...", colorful sugar-c

原创 Smith Numbers (POJ-1142)(素數判定+整數分解)

While skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the tele

原创 Web Navigation (POJ-1028)(堆棧)

Standard web browsers contain features to move backward and forward among the pages recently visited. One way to implem

原创 C-Super Star (POJ-2069)(最小球覆蓋+模擬退火)

During a voyage of the starship Hakodate-maru (see Problem 1406), researchers found strange synchronized movements of s

原创 Square Coins (HDU-1398)(母函數)

People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins

原创 找單詞 (HDU-2082)(母函數)

假設有x1個字母A, x2個字母B,..... x26個字母Z,同時假設字母A的價值爲1,字母B的價值爲2,..... 字母Z的價值爲26。那麼,對於給定的字母,可以找到多少價值<=50的單詞呢?單詞的價值就是組成一個單詞的所有字母的價值

原创 H - Is It A Tree? (POJ-1308)(HDU-1325)(並查集)

A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes conne

原创 Happy 2006 (POJ-2773)(容斥原理+二分)

Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instanc

原创 Big Event in HDU (HDU-1171)(母函數)

Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer C

原创 Crisis of HDU (HDU-2110)(母函數)

話說上回講到HDU大戰東洋小苟,結果自然是中方大勝,這一戰也使得海東集團在全球同行業中的地位更加鞏固。隨着集團的發展,很多創業時期的元老逐步功成身退,先是8600移民海外,然後是linle夫婦退隱山林,逐漸的,最初衆多的元老只剩下XHD夫

原创 母函數(對於初學者的最容易理解的)

普通母函數: 在用到母函數之前啊,恐怕很少有人聽過母函數,我也一樣,我當時是做杭電acm的2082題要用母函數做纔去瞭解母函數的。當然母函數分爲很多種,包括普通母函數、指數母函數、L級數、貝爾級數和狄利克雷級數,我這裏說的都是普通母函數。