原创 HDU 1754 線段樹

I Hate It Problem Description 很多學校流行一種比較的習慣。老師們很喜歡詢問,從某某到某某當中,分數最高的是多少。 這讓很多學生很反感。 不管你喜不喜歡,現在需要你做的是,就是按照老師的要求,寫一個程序,模

原创 HDU 1198 並查集

Farm Irrigation Problem Description Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is di

原创 HDU 1025 子序列

Constructing Roads In JGShining's Kingdom   Problem Description JGShining's kingdom consists of 2n(n is no more than 5

原创 HDU 2087 子序列

  剪花布條 Problem Description 一塊花布條,裏面有些圖案,另有一塊直接可用的小飾條,裏面也有一些圖案。對於給定的花布條和小飾條,計算一下能從花布條中儘可能剪出幾塊小飾條來呢?     Input 輸入中含有

原创 HDU 1686 子序列

Oulipo   Problem Description   The French author Georges Perec (1936–1982) once wrote a book, La disparition, without t

原创 HDU 2594 子序列

Simpsons’ Hidden Talents   Problem Description Homer: Marge, I just figured out a way to discover some of the talents w

原创 HDU 1711 子序列

Number Sequence   Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], .....

原创 HDU 2112 最短路徑

HDU Today Problem Description 經過錦囊相助,海東集團終於度過了危機,從此,HDU的發展就一直順風順水,到了2050年,集團已經相當規模了,據說進入了錢江肉絲經濟開發區500強。這時候,XHD夫婦也退居了二線,

原创 POJ 2524 並查集

Ubiquitous Religions   Description There are so many different religions in the world today that it is difficult to kee

原创 HDU 1257 子序列

最少攔截系統 Problem Description 某國爲了防禦敵國的導彈襲擊,發展出一種導彈攔截系統.但是這種導彈攔截系統有一個缺陷:雖然它的第一發炮彈能夠到達任意的高度,但是以後每一發炮彈都不能超過前一發的高度.某天,雷達捕捉到敵國

原创 HDU 1159 子序列

Common Subsequence Problem Description A subsequence of a given sequence is the given sequence with some elements (poss

原创 HDU 1423 子序列

Greatest Common Increasing Subsequence Problem Description This is a problem from ZOJ 2432.To make it easyer,you just n

原创 HDU 1548 BFS

A strange lift Problem Description There is a strange lift.The lift can stop can at every floor as you want, and there

原创 POJ 2001 字典樹

Shortest Prefixes   Description A prefix of a string is a substring starting at the beginning of the given string. The

原创 約瑟環夫問題

n個人   從1至N開始順序循環數數,每數到M時,將該數字退出,繼續從下個人開始數,最後一個退出的爲勝利者 把問題變成0-n-1(編號變了而已), 第一個人出列之後,(第一個人編號一定是m%n-1) 剩下的是n-1個人,編號從0-(n-2