
DFS
文章平均质量分 59
风之旅@
努力到一定的程度,幸运就会与你不期而遇
展开
-
B - Tempter of the Bone(DFS+剪枝+回溯)
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone...原创 2018-08-01 22:42:39 · 160 阅读 · 0 评论 -
HDU - 1520 Anniversary party (树形dp)
Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervis...原创 2019-02-27 22:21:16 · 131 阅读 · 0 评论 -
树的分治 POJ - 1741
树的分治 树的分治分为点分治和边分治,在这里先介绍点分治,边的分治以后补充 点分治: 点分治最重要的一点就是找树的重心,在将点分治之前先介绍什么是树的重心 树的重心:树的重心也叫树的质心。对于一棵树n个节点的无根树,找到一个点,使得把树变成以该点为根的有根树时,最大子树的结点数最小。 只看定义的话对于初学者...原创 2019-01-22 18:29:26 · 322 阅读 · 0 评论 -
POJ - 1321 棋盘问题
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k &...原创 2018-12-03 22:00:57 · 231 阅读 · 1 评论 -
CodeForces - 723D Lakes in Berland
The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or water. The map is surrounded by the ocean. Lakes are the maximal regions of wa...原创 2018-11-26 16:49:33 · 214 阅读 · 0 评论 -
CodeForces - 510B Fox And Two Dots
Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like this: E...原创 2018-11-20 14:22:10 · 181 阅读 · 0 评论 -
HDU - 2266 How Many Equations Can You Find
Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’-’ between the characters. Just like give you a string “12345”, you can work out a string...原创 2018-11-16 21:42:00 · 151 阅读 · 0 评论 -
HDU - 1241 Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides t...原创 2018-11-16 20:09:55 · 207 阅读 · 0 评论 -
HDU - 1312 Red and Black
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can...原创 2018-11-15 19:53:52 · 116 阅读 · 0 评论 -
HDU - 2196 Computer
A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled earlier. M...原创 2019-03-02 20:47:27 · 137 阅读 · 0 评论