- 博客(60)
- 收藏
- 关注
转载 How Many Answers Are Wrong HDU - 3038 并查集,加权(路径)
TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT sho...
2019-09-27 12:50:00
128
转载 How Many Tables HDU - 1213 并查集,集合数
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each oth...
2019-09-26 21:11:00
131
转载 The Suspects POJ - 1611 并查集,同集合的数
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is...
2019-09-26 20:22:00
156
转载 并查集算法
算法思想: 1.初始化功能:把每个点所在集合初始化为其自身。 2.查找功能:查找元素所在的集合,即根节点。 2.合并功能:将两个元素所在的集合合并为一个集合。 例题:若某个家族人员过于庞大,要判断两个是否是亲戚,确实不容易,给出某个亲戚关系图,求任意给出的两个人是否具有亲戚关系。 规定:x和y是亲戚,y和z是亲戚,那么x和z也是亲戚。如果x,y是亲戚,那么x的亲戚都是y的亲戚,...
2019-09-25 19:14:00
181
转载 Wireless Network POJ - 2236 并查集 坐标点的转换
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in ...
2019-09-25 18:29:00
124
转载 Layout POJ - 3169 最短路,SPFA算法+负环判断
Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows ...
2019-09-22 17:36:00
156
转载 The Shortest Path in Nya Graph HDU - 4725 最短路,SPFA算法+优先队列,网络层加虚拟点...
This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of this paragraph, ...
2019-09-22 15:09:00
142
转载 Extended Traffic LightOJ - 1074 最短路,单向道路,有负权,SPFA算法
Dhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach des...
2019-09-20 20:36:00
143
转载 Tram POJ - 1847 最短路,Dijktra算法,单向图
Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersect...
2019-09-20 12:01:00
144
转载 昂贵的聘礼 POJ - 1062 最短路,Dijkstra算法,加权等级
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其...
2019-09-16 16:59:00
90
转载 Subway POJ - 2502 最短路,Dijkstra算法,坐标转换
You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't ...
2019-09-16 14:54:00
187
转载 Candies POJ - 3159 最短路,SPFA算法
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. ...
2019-09-15 10:26:00
160
转载 Invitation Cards POJ - 1511 最短路,SPFA+单向往返图
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. ...
2019-09-09 19:30:00
152
转载 Arbitrage POJ - 2240 最短路Bellman判断正环
Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 B...
2019-09-09 12:03:00
106
转载 Cow Contest POJ - 3660 Floyd算法,关系链图
N(1 ≤N≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating tha...
2019-09-09 09:55:00
156
转载 Radar HDU - 2295 DLX,重复覆盖+剪枝
N cities of the Java Kingdom need to be covered by radars for being in a state of war. Since the kingdom has M radar stations but only K operators, we can at most operate K radars. All radars hav...
2019-09-08 21:46:00
174
转载 MPI Maelstrom POJ - 1502 最短路Dijkstra
BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research...
2019-09-08 21:36:00
122
转载 Wormholes POJ - 3259 最短路SPFA
While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time...
2019-09-07 11:14:00
87
转载 Currency Exchange POJ - 1860 最短路Bellman
Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. Ther...
2019-09-07 10:28:00
121
转载 Silver Cow Party POJ - 3268 最短路Dijkstra 正向图和方向图
One cow from each ofNfarms (1 ≤N≤ 1000) conveniently numbered 1..Nis going to attend the big cow party to be held at farm #X(1 ≤X≤N). A total ofM(1 ≤M≤ 100,000) unidirectional (one...
2019-09-06 19:57:00
208
转载 Heavy Transportation POJ - 1797 最短路Dijkstra
BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his...
2019-09-06 18:03:00
123
转载 DLX算法
理解DLX算法之前首先了解精确覆盖问题和重复覆盖问题 精确覆盖问题 何为精确覆盖问题 在一个全集X中若干子集的集合为S,精确覆盖(Exactcover)是指,S的子集S*,满足X中的每一个元素在S*中恰好出现一次。 定义 满足以下条件的集合为一个精确覆盖: S*中任意两个集合没有交集,即X中的元素在S*中出现最多一次 S*中集合的全集为X,即X中的元素...
2019-09-05 21:08:00
515
转载 最短路算法
例题:FroggerPOJ - 2253 链接https://vjudge.net/problem/POJ-2253 1. Floyd算法 算法思想:用mp[i][j]来表示i到j之间的距离,先对mp数组初始化,然后根据输入录入已知的i和j之间的距离,然后三重循环,第一重用k表示i和j之外的数,第二重为i,第三重为j。改变的思路是如果i到j之间的距离比i到k加上k到j之间的距离,...
2019-09-05 20:21:00
276
转载 Frogger POJ - 2253 最短路Floyd,Dijkstra,SPFA
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists...
2019-09-05 20:11:00
138
转载 Til the Cows Come Home POJ - 2387 最短路Dijksstra
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to ...
2019-09-05 18:45:00
84
转载 Airport HDU - 5046 DLX,重复覆盖+剪枝
The country of jiuye composed by N cites. Each city can be viewed as a point in a two- dimensional plane with integer coordinates (x,y). The distance between city i and city j is defined by dij...
2019-09-03 11:16:00
173
转载 Divisibility HDU - 3335 DLX,重复覆盖+剪枝
As we know,the fzu AekdyCoin is famous of math,especially in the field of number theory.So,many people call him "the descendant of Chen Jingrun",which brings him a good reputation.AekdyCoin also ...
2019-08-31 20:40:00
145
转载 Squiggly Sudoku HDU - 4069 DLX,不重复覆盖,数独多解判断
Today we play a squigglysudoku, The objective is to fill a 9*9 grid with digits so that each column, each row, and each of the nine Connecting-sub-grids that compose the grid contains all of the...
2019-08-31 19:23:00
363
转载 Sudoku ZOJ - 3122 DLX,不重复覆盖,16*16数独
A Sudoku grid is a 16x16 grid of cells grouped in sixteen 4x4 squares, where some cells are filled with letters fromAtoP(the first 16 capital letters of the English alphabet), as shown in fig...
2019-08-31 10:36:00
305
转载 Sudoku POJ - 3074 DLX,不重复覆盖,9*9数独
In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, . 2 7 3 8 . . 1 . . 1 . . . 6 7 3 5 . . . . . ....
2019-08-30 14:36:00
206
转载 Exact cover HUST - 1017 DLX,不重复覆盖
There is an N*M matrix with only 0s and 1s, (1 <= N,M <= 1000). An exact cover is a selection of rows such that every column has a 1 in exactly one of the selected rows.Try to find out the...
2019-08-25 15:56:00
100
转载 删括号
题目描述 给你一个合法的括号序列s1,每次你可以删除一个"()" 你可以删除0个或者多个"()" 求能否删成另一个括号序列s2 输入描述: 第一行输入一个字符串s (2 ≤ |s| ≤ 100)第二行输入一个字符串t (2 ≤ |t| ≤ 100 ) 输出描述: 如果可以输出"Possible"否则输出"Impossible" 示例1 输入...
2019-08-21 13:14:00
352
转载 被3整除的子序列
题目描述 给你一个长度为50的数字串,问你有多少个子序列构成的数字可以被3整除 答案对1e9+7取模 输入描述: 输入一个字符串,由数字构成,长度小于等于50 输出描述: 输出一个整数 示例1 输入 132 输出 3 示例2 输入 9 输出 1 示...
2019-08-21 13:07:00
251
转载 A - Por Costel and Azerah
Por Costel the Pig has received a royal invitation to the palace of the Egg-Emperor of Programming, Azerah. Azerah had heard of the renowned pig and wanted to see him with his own eyes. Por Cos...
2019-08-20 11:30:00
105
转载 Coins POJ - 1742
People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch in a ...
2019-08-02 09:42:00
191
转载 Coins POJ - 1742
People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch in a ...
2019-08-02 09:42:00
119
转载 Cheapest Palindrome POJ - 3280
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the cows ...
2019-08-01 10:07:00
132
转载 Cheapest Palindrome POJ - 3280
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the cows ...
2019-08-01 10:07:00
66
转载 Milking Time POJ - 3616
Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her nextN(1 ≤N≤ 1,000,000) hours (conveniently labeled 0..N-1) so t...
2019-07-31 18:58:00
80
转载 Apple Catching POJ - 2385
It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when t...
2019-07-31 11:49:00
75
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人