原创 fzu 2041 Checker 枚舉 模擬

Description Checker game is an interesting game. But now Bob is tired of playing with others, he wants to play by

原创 poj 1088 滑雪 動態規劃 記憶化搜索

滑雪 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 92206   Accepted: 34883 Description Michael喜歡滑雪百這

原创 POJ1077 HDU1043 Eight 八數碼第四境界 雙向廣搜 康託展開 逆康託

Eight Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 30632   Accepted: 13332   Special Judge Descrip

原创 POJ 1062 昂貴的聘禮 構圖 最短路

昂貴的聘禮 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 46053   Accepted: 13661 Description 年輕的探險家來到了一

原创 poj1019 Number Sequence 思維 遞推

Number Sequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 38481   Accepted: 11166 Description

原创 hihocoder 1044 動態規劃 狀態壓縮

#1044 : 狀態壓縮·一 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 小Hi和小Ho在兌換到了喜歡的獎品之後,便繼續起了他們的美國之行,思來想去,他們決定乘坐火車前往下一座城市

原创 ZOJ 3956 Course Selection System 01揹包

Course Selection System Time Limit: 1 Second      Memory Limit: 65536 KB There are n courses in the course selection

原创 二叉樹 由中序遍歷和前序遍歷推後序遍歷

根據後序遍歷’=‘左子樹的後序遍歷’+‘右子樹的後序遍歷’+‘根節點遞歸求解即可 char pre[maxn], in[maxn], post[maxn]; void Post(char* _pre, char* _in, int _l

原创 hihoCoder #1050 : 樹中的最長路

#1050 : 樹中的最長路 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 上回說到,小Ho得到了一棵二叉樹玩具,這個玩具是由小球和木棍連接起來的,而在拆拼它的過程中,小Ho發現他不僅僅

原创 Codeforces Round #378 (Div. 2) C. Epidemic in Monstropolis

C. Epidemic in Monstropolis time limit per test 1 second memory limit per test 256 megabytes input standard inp

原创 UVALive - 3989 Ladies' Choice 穩定婚姻問題

Teenagers from the local high school have asked you to help them with the organization of next year’s Prom. The idea is

原创 URAL - 1989 Subpalindromes hash & 樹狀數組 | 線段樹

1989. Subpalindromes Time limit: 0.5 second Memory limit: 64 MB You have a string and queries of two types: r

原创 洛谷 P1880 石子合併 區間dp

題目描述 在一個園形操場的四周擺放N堆石子,現要將石子有次序地合併成一堆.規定每次只能選相鄰的2堆合併成新的一堆,並將新的一堆的石子數,記爲該次合併的得分。 試設計出1個算法,計算出將N堆石子合併成1堆的最小得分和最大得分.

原创 poj 1113 Wall 計算幾何 凸包 Graham掃描

Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 35684   Accepted: 12177 Description Once upon a

原创 洛谷 P1064 金明的預算方案 依賴揹包

題目描述 金明今天很開心,家裏購置的新房就要領鑰匙了,新房裏有一間金明自己專用的很寬敞的房間。更讓他高興的是,媽媽昨天對他說:“你的房間需要購買哪些物品,怎麼佈置,你說了算,只要不超過N元錢就行”。今天一早,金明就開始做預算了,他