原创 poj1469 COURSES

Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your

原创 hdu1233 還是暢通工程

Description 某省調查鄉村交通狀況,得到的統計表中列出了任意兩村莊間的距離。省政府“暢通工程”的目標是使全省任何兩個村莊間都可以實現公路交通(但不一定有直接的公路相連,只要能間接通過公路可達即可),並要求鋪設的公路總長度爲最小。

原创 poj2562 Primary Arithmetic

Description Children are taught to add multi-digit numbers from right-to-left one digit at a time. Many find the "carry

原创 poj1751 Highways

Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public h

原创 poj1664 放蘋果

Description 把M個同樣的蘋果放在N個同樣的盤子裏,允許有的盤子空着不放,問共有多少種不同的分法?(用K表示)5,1,1和1,5,1 是同一種分法。 Input 第一行是測試數據的數目t(0 <= t <= 20)。以下每行均

原创 連號區間數

問題描述小明這些天一直在思考這樣一個奇怪而有趣的問題:在1~N的某個全排列中有多少個連號區間呢?這裏所說的連號區間的定義是:如果區間[L, R] 裏的所有元素(即此排列的第L個到第R個元素)遞增排序後能得到一個長度爲R-L+1的“連續”數

原创 高精度乘法

#include <iostream>#include <stdio.h>#include <stdlib.h>#include <string>#i

原创 poj1144 Network

Description A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several p

原创 poj2752 Seek the Name, Seek the Fame

Description The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little c

原创 poj1700 Crossing River

Description A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Th

原创 hdu1002 A + B Problem II

Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B

原创 poj1423 Big Number

Description In many applications very large integers numbers are required. Some of these applications are using keys fo

原创 hdu1251 統計難題

Description Ignatius最近遇到一個難題,老師交給他很多單詞(只有小寫字母組成,不會有重複的單詞出現),現在老師要他統計出以某個字符串爲前綴的單詞數量(單詞本身也是自己的前綴). Input 輸入數據的第一部分是一張單詞

原创 hdu3790 最短路徑問題

Description 給你n個點,m條無向邊,每條邊都有長度d和花費p,給你起點s終點t,要求輸出起點到終點的最短距離及其花費,如果最短距離有多條路線,則輸出花費最少的。 Input 輸入n,m,點的編號是1~n,然後是m行,每行4個

原创 hdu1863 暢通工程

Description 省政府“暢通工程”的目標是使全省任何兩個村莊間都可以實現公路交通(但不一定有直接的公路相連,只要能間接通過公路可達即可)。經過調查評估,得到的統計表中列出了有可能建設公路的若干條道路的成本。現請你編寫程序,計算出全