
poj
文章平均质量分 76
Strive_Buff
面向未来,才能创造未来。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 1321 棋盘问题---[kuangbin带你飞]专题一 简单搜索
Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k原创 2016-10-12 18:16:52 · 437 阅读 · 0 评论 -
poj 1679 The Unique MST ([kuangbin带你飞]专题八 生成树 )
题目大意:给你一个无向图,问如果这个无向图的最小生成树是唯一的就输出最小生成树的权值,否则输出Not Unique! 解题思路,求次小生成树,如果次小生成树中有何最小的权值一样的,则生成树不唯一,否则唯一用Kruskal,求最小生成树,然后枚举其中一个边去掉以后(n-1条),再求最小生成树,然后和原来的权值比较, #include #include #include using nam原创 2016-11-15 20:00:53 · 461 阅读 · 0 评论 -
poj 3264 Command Network(最小树形图)
有一副有向图,要求从根节点起能访问到所有的结点,且路径最短。即求最小树形图。 算法位朱刘算法, 裸的最小树形图,用朱—刘算法解决,具体实现过程如下:算法一开始先判断从固定根开始是否可达所有原图中的点,若不可,则一定不存在最小树形图。这一步是一个很随便的搜索,写多搓都行,不加废话。第二步,遍历所有的边,从中找出除根结点外各点的最小入边,累加权值,构成新图。接着判断该图是否存在环。若不存在,则该图原创 2016-11-18 16:13:18 · 441 阅读 · 0 评论 -
poj 3026 Borg Maze
题目大意:s会分裂,然后从s到A的最小的步是多少。 解题思路:先bfs算出A或者S到任何点的距离,然后最求最小生成树,用dij或者prim都可以 #include #include #include #include #include using namespace std; const int maxn = 100+10; char mp[maxn][maxn]; int c原创 2016-11-15 10:24:20 · 393 阅读 · 0 评论 -
poj 2240 Arbitrage ([kuangbin带你飞]专题四 最短路练习)
Description 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原创 2016-11-02 18:33:04 · 820 阅读 · 0 评论 -
poj 3259 Wormholes ([kuangbin带你飞]专题四 最短路练习)
Description 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原创 2016-11-01 11:28:23 · 520 阅读 · 0 评论 -
poj 1502 MPI Maelstrom([kuangbin带你飞]专题四 最短路练习)
Description 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'原创 2016-11-01 17:10:40 · 464 阅读 · 0 评论 -
poj 3660 Cow Contest ([kuangbin带你飞]专题四 最短路练习)
Description 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原创 2016-11-02 15:45:23 · 426 阅读 · 0 评论 -
POJ 1797 Heavy Transportation
Description Background Hugo 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 t原创 2016-11-10 16:29:01 · 349 阅读 · 0 评论 -
poj 3268 Silver Cow Party ([kuangbin带你飞]专题四 最短路练习)
Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirect原创 2016-11-10 15:49:07 · 440 阅读 · 0 评论 -
poj 1860 Currency Exchange ([kuangbin带你飞]专题四 最短路练习)
Description 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 curren原创 2016-11-10 15:40:12 · 544 阅读 · 0 评论 -
POJ 3414 Pots([kuangbin带你飞]专题一 简单搜索)
题目连接:题目 题目大意:给你A,B两个杯子和一同水,问你能用两个杯子倒出C的水吗, 解题思路,这个题和非常可乐这个题很相似,其实差不多,但是这个题比较麻烦一些,,标记各种情况 #include #include #include #include #include using namespace std; int a,b,c; const int maxn = 100+5;原创 2016-10-16 20:56:14 · 483 阅读 · 0 评论 -
poj 3126 Prime Path([kuangbin带你飞]专题一 简单搜索)
题目连接:题目 题目大意:两个素数,每次可以改变前一个数的某一位,并且改变完还是素数,求从第一个数变成第二个数的最小步数 解题思路:能读懂题目就差不多能知道用bfs,枚举每一位,改变数,看是不是素数, #include #include #include #include #include #include #include #include using namespace std; boo原创 2016-10-16 15:47:04 · 504 阅读 · 0 评论 -
POJ 1426 Find The Multiple([kuangbin带你飞]专题一 简单搜索 )
题目连接:题目 ————————题目大意:给你一个数,找出他的倍数,并且只含有1和0的,输出任意一个 解题思路:枚举所有的由1,0组成的数,找出n的倍数 枚举方式1--->1*10,1*10+1;这样每次取队列的首位*10 或者*10+1; #include #include #include using namespace std; typedef unsigned l原创 2016-10-16 14:24:14 · 347 阅读 · 0 评论 -
poj 3279 Fliptile
POJ-3279-Fliptile Time Limit:2000MS Memory Limit:65536KB Description Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has转载 2016-10-15 13:40:48 · 385 阅读 · 0 评论 -
poj 3728 Catch That Cow ([kuangbin带你飞]专题一 简单搜索)
题目大意:题目链接 就是给你N,K,每次有三种惭怍+1,-1,*2,,问多少次操作能到K 解题思路,搜索直接算,。,,,哎,啥时候这种垃圾搜索我能直接A 啊,太菜了 #include #include #include #include using namespace std; const int maxn = 1000000+10; int vis[maxn]={0};原创 2016-10-14 21:54:32 · 396 阅读 · 0 评论 -
Dungeon Master([kuangbin带你飞]专题一 简单搜索)
题目大意:题目链接 给个多层的迷宫,求从起点到终点的最短路径,不能到达就输出Trapped! 解体思路: bfs直接搜,没什么好说的,一开始忘记清空队列一只WA,果然我还是菜鸡 #include #include #include #include #include #include using namespace std; struct node{ int x,y,z;原创 2016-10-14 21:48:11 · 438 阅读 · 0 评论 -
最小树形图
/*本题为不是固定根的最小树形图,我们可以虚拟出一根来,然后在把这个根跟每个点相连,相连的点可以设为无穷大,或者设为所有边和大一点,比如为r,然后就可以利用最小树形图进行计算了,计算出的结果减去r,如果比r还大就可以认为通过这个虚拟节点我们连过原图中两个点,即原图是不连通的,我们就可以认为不存在最小树形图。关于输出最小根也挺简单,在找最小入弧时,如果这条弧的起点是虚拟根,那么这条弧的终点就是要求的原创 2017-12-08 10:28:10 · 396 阅读 · 0 评论