POJ 1236 – Network of Schools [tarjan-强连通分量]


Link 传送门 Problem A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving schools”). Note that if B is ...

POJ 1236 – Network of Schools [tarjan-强连通分量]

Link 传送门 Problem A number of schools are connected to a computer network. Agreements have been developed among those schools: each school mainta...
阅读全文 0

HDU 1274 – 展开字符串 [递归]


Link 传送门 Problem 在纺织CAD系统开发过程中,经常会遇到纱线排列的问题。 该问题的描述是这样的:常用纱线的品种一般不会超过25种,所以分别可以用小写字母表示不同的纱线,例如:abc表示三根纱线的排列;重复可以用数字和括号表示,例如:2(abc)表示abcabc;1(a)...

HDU 1274 – 展开字符串 [递归]

Link 传送门 Problem 在纺织CAD系统开发过程中,经常会遇到纱线排列的问题。 该问题的描述是这样的:常用纱线的品种一般不会超过25种,所以分别可以用小写字...
阅读全文 0

HDU 3768 – Shopping [最短路+全排列枚举]


Link 传送门 Problem You have just moved into a new apartment and have a long list of items you need to buy. Unfortunately, to buy this many items requires going to many different stores. You would like to minimize the amount of driving necessary t...

HDU 3768 – Shopping [最短路+全排列枚举]

Link 传送门 Problem You have just moved into a new apartment and have a long list of items you need to buy. Unfortunately, to buy this many items r...
阅读全文 0

HDU 1043 – Eight [最经典的BFS]


Link 传送门 Problem The 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 ...

HDU 1043 – Eight [最经典的BFS]

Link 传送门 Problem The 15-puzzle has been around for over 100 years; even if you don’t know it by that name, you’ve seen it. It is con...
阅读全文 0

HDU 4491 – Windmill Animation [几何]


Link 传送门 Problem A windmill animation works as follows: A two-dimensional set of points, no three of which lie on a line is chosen. Then one of the points is chosen (as the first pivot) and a line is drawn through the chosen point at some initi...

HDU 4491 – Windmill Animation [几何]

Link 传送门 Problem A windmill animation works as follows: A two-dimensional set of points, no three of which lie on a line is chosen. Then one of ...
阅读全文 0

HDU 4490 – Mad Veterinarian [无脑BFS]


Link 传送门 Problem Mad Veterinarian puzzles have a mad veterinarian, who has developed several machines that can transform an animal into one or more animals and back again. The puzzle is then to determine if it is possible to change one collecti...

HDU 4490 – Mad Veterinarian [无脑BFS]

Link 传送门 Problem Mad Veterinarian puzzles have a mad veterinarian, who has developed several machines that can transform an animal into one or m...
阅读全文 0

POJ 2954 – Triangle [几何/Pick定理]


Link 传送门 Problem A lattice point is an ordered pair (x, y) where x and y are both integers. Given the coordinates of the vertices of a triangle (which happen to be lattice points), you are to count the number of lattice points which lie complet...

POJ 2954 – Triangle [几何/Pick定理]

Link 传送门 Problem A lattice point is an ordered pair (x, y) where x and y are both integers. Given the coordinates of the vertices of a triangle ...
阅读全文 0

URAL 1605 – Devil’s Sequence [打表规律+高精度小数]


Link 传送门 Problem Robodevil likes to do some mathematics between rehearsals of his orchestra. Today he invented devilish sequence No. 1729: x0 = 0, x1 = 1, xn = (xn − 1 + xn − 2) / 2. For example, x10 = 0.666015625. Robodevil became interested...

URAL 1605 – Devil’s Sequence [打表规律+高精度小数]

Link 传送门 Problem Robodevil likes to do some mathematics between rehearsals of his orchestra. Today he invented devilish sequence No. 1729: x0 =...
阅读全文 0

POJ 3617 – Best Cow Line [贪心+枚举]


Link 传送门 Problem FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual”Farmer of the Year” competition. In this contest every farmer arranges his cows in a line and herds them past the judges. The contest organizers adopted a...

POJ 3617 – Best Cow Line [贪心+枚举]

Link 传送门 Problem FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual”Farmer of the Year” competition. In this contest every...
阅读全文 0

POJ 2433 – Landscaping [贪心]


Link 传送门 Mean 有N列星星,组成了若干座山峰,每次去掉一些星星从而去掉一座山峰。最后只剩下K坐山峰,问你最少去多少星星。 Analysis 每次查找最小的山峰(去掉星星数量最少)去掉即可。遍历需要姿势和技巧。 Code #include <cstdio> #include <algo...

POJ 2433 – Landscaping [贪心]

Link 传送门 Mean 有N列星星,组成了若干座山峰,每次去掉一些星星从而去掉一座山峰。最后只剩下K坐山峰,问你最少去多少星星。 Analysis 每次查找最小的山峰...
阅读全文 0