原创 HDOJ 2120 Ice_cream's world I

Ice_cream’s world I ice_cream’s world is a rich country, it has many fertile lands. Today, the queen of ice_cream w

原创 HDU1301 Jungle Roads

Jungle Roads The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was sp

原创 百度之星初賽A 今夕何夕

今夕何夕 今天是2017年8月6日,農曆閏六月十五。 小度獨自憑欄,望着一輪圓月,發出了“今夕何夕,見此良人”的寂寞感慨。 爲了排遣鬱結,它決定思考一個數學問題:接下來最近的哪一年裏的同一個日子,和今天的星期數一樣?比如今天

原创 poj 2533Longest Ordered Subsequence

Longest Ordered Subsequence Description A numeric sequence of ai is ordered if a1 < a2 < … < aN. Let the subsequenc

原创 最長遞增子序列(模板)

最長公共子序列 (模板) 時間複雜度nlog(n); 原理解釋 : 我推薦看這篇博客,慢慢理解。 #include<cstdio> #include<algorithm> using namespace std; const

原创 poj 1383 Labyrinth

poj 1383 Labyrinth 【 BFS實現 樹的直徑裸題】 The northern part of the Pyramid contains a very large and complicated labyrint

原创 hdu 1257最少攔截系統

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

原创 LightOJ 1141 Number Transformation

Number Transformation In this problem, you are given an integer number s. You can transform any integer number A to

原创 hdu 1325 Is It A Tree? (並查集)

Is It A Tree? A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one

原创 The Suspects POJ 1611

The Suspects Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized

原创 HDU1272小希的迷宮

小希的迷宮 上次Gardon的迷宮城堡小希玩了很久(見Problem B),現在她也想設計一個迷宮讓Gardon來走。但是她設計迷宮的思路不一樣,首先她認爲所有的通道都應該是雙向連通的,就是說如果有一個通道連通了房間A和B,那麼既

原创 POJ 1287 Networking

Networking You are assigned to design network connections between certain points in a wide area. You are given a se

原创 POJ1789-Truck History

Truck History Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable deli

原创 HDU 5631 Rikka with Graph

Rikka with Graph As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some m

原创 poj-1751-Highways-(最小生成樹)

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