原创 The more, The Better HDU - 1561(樹形dp)

傳送門 ACboy很喜歡玩一種戰略遊戲,在一個地圖上,有N座城堡,每座城堡都有一定的寶物,在每次遊戲中ACboy允許攻克M個城堡並獲得裏面的寶物。但由於地理位置原因,有些城堡不能直接攻克,要攻克這些城堡必須先攻克其他某一個特定的城堡。你

原创 codeforces839C Journey(DFS)

點擊打開鏈接 C. Journey time limit per test 2 seconds memory limit per test 256 megabytes input standard input outp

原创 HDU - 3652 : B-number (數位dp)

題目鏈接 : 杭電3652 A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- stri

原创 Anniversary party HDU - 1520(樹形dp)

傳送門 There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a

原创 CodeForces - 734D Anton and Chess (思維題)

點擊打開鏈接 Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that p

原创 TELE POJ - 1155 (樹形dp)

傳送門 A TV-network plans to broadcast an important football match. Their network of transmitters and users can be repres

原创 hihocoder第九十六週 數論五·歐拉函數

點擊打開鏈接 #1298 : 數論五·歐拉函數 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 小Hi和小Ho有時候會用密碼寫信來互相聯繫,他們用了一個很大的數當做密鑰。小Hi和小Ho約

原创 POJ - 3252 : Round Numbers (數位dp)

題目鏈接 : POJ-3252 The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone'

原创 Find MaxXorSum NBUT - 1597(字典樹)

點擊打開鏈接 Given n non-negative integers, you need to find two integers a and b that a xor b is maximum. xor is exclusive-

原创 HDU - 1251 統計難題 (字典樹)

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

原创 FZU - 2271(最短路變形)

點擊打開鏈接 X is a fully prosperous country, especially known for its complicated transportation networks. But recently, f

原创 CodeForces - 734E Anton and Tree(樹的直徑)

點擊打開鏈接 Anton is growing a tree in his garden. In case you forgot, the tree is a connected acyclic undirected graph. Th

原创 hihocoder第九十三週 數論二·Eular質數篩法

傳送門 #1295 : 數論二·Eular質數篩法 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 小Ho:小Hi,上次我學會了如何檢測一個數是否是質數。於是我又有了一個新的問題,我如何

原创 String painter hdu2476(區間dp)

點擊打開鏈接 String painter Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi

原创 hihocoder第九十四周 數論三·約瑟夫問題

點擊打開鏈接 #1296 : 數論三·約瑟夫問題 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 小Hi和小Ho的班級正在進行班長的選舉,他們決定通過一種特殊的方式來選擇班長。 首先N個