亟隐

朝不闻道,夕亦死可矣

10/27
22:08
图论 算法区

BZOJ 2144 跳跳棋

地址:戳这里

Description

跳跳棋是在一条数轴上进行的。棋子只能摆在整点上。每个点不能摆超过一个棋子。我们用跳跳棋来做一个简单的游戏:棋盘上有3颗棋子,分别在a,b,c这三个位置。我们要通过最少的跳动把他们的位置移动成x,y,z。(棋子是没有区别的)跳动的规则很简单,任意选一颗棋子,对一颗中轴棋子跳动。跳动后两颗棋子距离不变。一次只允许跳过1颗棋子。 写一个程序,首先判断是否可以完成任务。如果可以,输出最少需要的跳动次数。 Read More →

08/5
01:00
图论 算法区

HDU 5348 MZL's endless loop

地址:戳这里

Problem Description
As we all kown, MZL hates the endless loop deeply, and he commands you to solve this problem to end the loop.
You are given an undirected graph with n vertexs and m edges. Please direct all the edges so that for every vertex in the graph the inequation |out degree  in degree|1 is satisified.
The graph you are given maybe contains self loops or multiple edges.

Read More →

08/2
22:32
图论 算法区

HDU 4338 Simple Path

地址:戳这里

Problem Description
Everybody knows that totalfrank has absolutely no sense of direction. Getting lost in the university or nearly supermarket is very common for him. We always worry about whether he can find his way back into our sweet base whenever he goes out alone for his class. In general, if totalfrank get lost again, we need to check his starting point and destination just in order to find out where he could be (you know this task is very common for us). 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/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 →
11/13
11:58
图论 算法区 网络流

SPOJ 2899 Volunteers 费用流

地址:戳这里

ACM ICPC World Finals 2009, sponsored by IBM and hosted by KTH, Royal Institute of Technology will be held in Stockholm, Sweden. This contest will last for N(1<= N <= 1000) days. We need at least Aivolunteers in the i-th day. Now there are M(1<= M <=10000) kind of volunteers. The i-th type of volunteers will work from Si-th day to Ti-th day, we will pay them $Ci. Now your task is to minimize the money KTH pay for all the volunteers. Read More →

10/1
22:02
图论 算法区

BZOJ 3714 [PA2014]Kuglarz MST

地址:戳这里

Description

魔术师的桌子上有n个杯子排成一行,编号为1,2,…,n,其中某些杯子底下藏有一个小球,如果你准确地猜出是哪些杯子,你就可以获得奖品。花费c_ij元,魔术师就会告诉你杯子i,i+1,…,j底下藏有球的总数的奇偶性。
采取最优的询问策略,你至少需要花费多少元,才能保证猜出哪些杯子底下藏着球?

Read More →