亟隐

朝不闻道,夕亦死可矣

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/26
22:33
图论 算法区

HDU 4253 Two Famous Companies

地址:戳这里

Problem Description
In China, there are two companies offering the Internet service for the people from all cities: China Telecom and China Unicom. They both are planning to build cables between cities. Obviously, the government wants to connect all the cities in minimum costs. So the minister of finance Mr. B wants to choose some of the
cable plans from the two companies and calculate the minimum cost needed to connect all the cities. 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 →

07/23
11:38
图论 算法区 网络流

HDU 4067 Random Maze

地址:戳这里

Problem Description
In the game “A Chinese Ghost Story”, there are many random mazes which have some characteristic:
1.There is only one entrance and one exit.
2.All the road in the maze are unidirectional.
3.For the entrance, its out-degree = its in-degree + 1.
4.For the exit, its in-degree = its out-degree + 1.
5.For other node except entrance and exit, its out-degree = its in-degree. Read More →
05/28
23:27
算法区

HDU 5244 inverse

地址:戳这里

Problem Description

Mike has got a huge array b, and he is told that the array is encrypted.

The array is encrypted as follows.

Let ai(0i<n) be the i-th number of this original array.

Let bi(0i<n) be the i-th number of this encrypted array.

Let n be a power of 2, which means n=2k.

The bi is calculated as following.

bi=0j<nf((i or j) xor i)aj

f(x) means, if the number of 1 in the binary of x is even, it will return 1, otherwise 0.
Read More →