亟隐

朝不闻道,夕亦死可矣

09/15
00:02
DP 数学 算法区

HDU 4626 Jinkeloid

地址:戳这里

Problem Description
After listening several songs of Jinkeloid,I come up with this problem :).
There is a string s only consist of first 20 lowercase English letters.
And we have several queries,each time I have k letters c1, c2, …, ck,and I wonder how many consecutive substring of string s that each ci has occur even times in it.
Two substring with the same content but different position are considered different.

Read More →

08/1
00:42
DP 算法区

HDU 4314 Save the dwarfs

地址:戳这里

Problem Description

Several dwarfs are trapped in a deep well. They are not tall enough to climb out of the well, so they want to make a human-pyramid, that is, one dwarf stands on another’s shoulder, until the dwarf on the top can reach the top of the well when he raise his arms up. More precisely speaking, we know the i-th dwarf’s height from feet to shoulder is Ai, and his arm length Bi. And we know the height of the well is H. If we can build a dwarf-tower consists of dwarf 1, dwarf 2, …, dwarf k from bottom to top, such that A1 + A2 + … + Ak-1 + Ak + Bk >= H, then dwarf k can escape from the well. Obviously, the escaped dwarf can’t be used to build tower again. Read More →

07/26
22:41
DP 算法区

HDU 4219 Randomization?

地址:戳这里

Problem Description
Random is the real life. What we see and sense everyday are absolutely randomly happened. Randomization is the process of making something random, as the nature.
Given a tree with N nodes, to be more precisely, a tree is a graph in which each pair of nodes has and only has one path. All of the edges’ length is a random integer lies in interval [0, L] with equal probability. iSea want to know the probability to form a tree, whose edges’ length are randomly generated in the given interval, and in which the path’s length of every two nodes does not exceed S.

Read More →

07/25
22:09
DP 数据结构 算法区

HDU 4169 Wealthy Family

地址:戳这里

Problem Description

While studying the history of royal families, you want to know how wealthy each family is. While you have various ‘net worth’ figures for each individual throughout history, this is complicated by double counting caused by inheritance. One way to estimate the wealth of a family is to sum up the net worth of a set of k people such that no one in the set is an ancestor of another in the set. The wealth of the family is the maximum sum achievable over all such sets of k people. Read More →

07/24
16:21
DP 图论 算法区

HDU 4126 Genghis Khan the Conqueror

地址:戳这里

Problem Description

Genghis Khan(成吉思汗)(1162-1227), also known by his birth name Temujin(铁木真) and temple name Taizu(元太祖), was the founder of the Mongol Empire and the greatest conqueror in Chinese history. After uniting many of the nomadic tribes on the Mongolian steppe, Genghis Khan founded a strong cavalry equipped by irony discipline, sabers and powder, and he became to the most fearsome conqueror in the history. He stretched the empire that resulted in the conquest of most of Eurasia. The following figure (origin: Wikipedia) shows the territory of Mongol Empire at that time. Read More →

05/14
20:16
DP 算法区

HDU 5136 Yue Fei's Battle

地址:戳这里

Problem Description

Yue Fei is one of the most famous military general in Chinese history.He led Southern Song army in the wars against the Jin dynasty of northern China. Yue Fei achieved a lot of victory and hopefully could retake Kaifeng ,the former capital of Song occupied by Jin. Fearing that retaking Kaifeng might cause the Jin to release former Emperor Song Qinzong, threatening his throne, Emperor Song Gaozong took some corrupted officers’ advice, sending 12 urgent orders in the form of 12 gold plaques to Yue Fei, recalling him back to the capital. Read More →

11/23
23:10
DP 算法区

CodeForces 490 F Treeland Tour DP

地址:戳这里

The “Road Accident” band is planning an unprecedented tour around Treeland. The RA fans are looking forward to the event and making bets on how many concerts their favorite group will have.

Treeland consists of n cities, some pairs of cities are connected by bidirectional roads. Overall the country has n - 1 roads. We know that it is possible to get to any city from any other one. The cities are numbered by integers from 1 to n. For every city we know its valueri — the number of people in it. Read More →