自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(162)
  • 资源 (1)
  • 收藏
  • 关注

原创 poj3723Conscription之dijkstra解法

题意:招纳n个女兵,m个男兵,给出r个亲密关系.当已招募的人中有一些关系亲密的人就可以减少费用,此时招募费用是10000-亲密关系.分析:男兵女兵间的亲密关系可以抽象为一条带权的边,问题就转化为了求权重和最小的树,反过来就是求最小生成树.考虑用dijkstra,在输入时把权值取负或用10000减去它获取新权值,然后男兵女兵序号有重复的,所以需要女兵或男兵区间右移下/** Filename:

2017-10-08 17:48:37 247

原创 poj3255Roadblocks之dijkstra解法

分析:到某个顶点的v次短路径要么是到u的最短路径+u->v的边,要么是到u的次短路径加上u->v的边.因此,我们可以在dijkstra求最短路径的基础上进行改进,在更新最短路径的过程中,记录并更新次短路径./** Filename: code.cpp* Created: 2017-10-08* Author: wyl6 *[mail:17744454343@163

2017-10-08 15:45:55 747

原创 POJ2349Arctic Network之最小生成树kruskal解法

Arctic Network Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 23142 Accepted: 7110 DescriptionThe Department of National Defence (DND) wishes to connect several northern outp

2017-10-03 17:42:10 322

原创 poj2253 frog之最小生成树prim解法

分析:对节点间关系进行分析,可以发现,从Freddy到Fiona节点的每次跳跃都是在寻找最短路径,这和prim算法生成最小生成树的方法是一致的.所以可以直接在prim算法上求解答案.首先看下prim模板int cost[INF][INF];//边int used[INF];int mincost[INF];//已参与生成的所有节点到节点v的最小值int v;int prim(){

2017-10-03 15:10:45 342

原创 poj2485 highways 之prim解法

分析:prim模板题,直接水过/** Filename: code.cpp* Created: 2017-10-03* Author: wyl6 *[mail:17744454343@163.com]* Desciption: Desciption*/#include <cstdio>#include <cstdlib>#include <iostr

2017-10-03 11:40:43 219

原创 POJ2253 Frogger之Floyd解法

题意:题意很好懂,就是要求一条路径,使得路径中最大的那一步是所有路径中最大步的最小值分析:设d[][]为从i到j的所有路径中,每条路径的最大步的最小值.对于d[i][j] 来说,考虑一个新的节点d[i][k]+d[k][j], 都要满足d[i][j]大于d[i][k]和d[k][j]中的最大值,否则就不更新.ps:现在编译规则越来越严了,sqrt和pow太容易出错了,以后要注意格式要规范…#incl

2017-09-28 13:32:54 569

原创 poj 3984 bfs+路径还原

分析:路径还原相当于在搜索的过程中保留一个关系链,在这里搜索到最后一步后,输出第一步到最后一步经过的节点,最先考虑的是栈的存储 分析:代码主要分为2部分:宽搜和路径还原#include <cstdio>#include <cstdlib>#include <iostream>#include <stack>#include <queue>#include <algorithm>#inc

2017-09-27 20:12:18 306

原创 poj1125 floyd解法

Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 37400 Accepted: 20793 DescriptionStockbrokers are known to overreact to rumours. You have been contracted

2017-09-27 16:13:07 290

原创 hdu2553 n皇后问题

分析:从第一行到最后一行依次放置皇后,判断条件有三个:这一列没有被标记左下到右上没有被标记右下到左上没有被标记我们发现两条斜对角线线的坐标满足一定关系:左下-右上:x+y相等右下-左上:x-y相等(可能有负数,+n将结果区间右移)#include <cstdio>#include <iostream>#include <cstring>using namespace std;in

2017-09-18 12:39:11 386

原创 poj1847Tram的dijkstra解法

题意: 首先输入n,a,b 然后输入n行,第i(1 =< i <= n)行的第一个数字表示从这站出发的列车数目Ki,然后接下来的Ki个数表示目的车站,其中第一个数表示默认目的地,如果需要到其他站需要改变switch,求从a到b需要改变switch的最小次数 分析:设默认目的地cost为0,其他为1,那么就变成求最短路径的问题,直接代入公式./** Filename:

2017-08-11 16:24:08 267

原创 poj3268Silver Cow Party之dijkstra解法

Silver Cow Party Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 23651 Accepted: 10789 DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is goi

2017-08-10 22:26:42 264

原创 poj3259Wormholes Bellman-Ford

Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 53846 Accepted: 20049 DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormh

2017-08-09 17:03:56 246

原创 poj1860之Bellman-Ford解法

Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 31398 Accepted: 11916 DescriptionSeveral currency exchange points are working in our city. Let us suppose tha

2017-08-09 15:30:50 519

原创 poj2236Wireless Network之并查集解法

Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 29118 Accepted: 12049 DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical

2017-07-25 22:12:38 369

原创 POJ1182食物链之并查集解法

食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 74500 Accepted: 22124 Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到

2017-07-25 14:47:55 386

原创 poj 1002 487-3279之map解法

487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 293365 Accepted: 52575 DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone numb

2017-07-24 20:07:55 925

原创 poj 3253 Fence Repair之优先队列解法

Fence Repair Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 50747 Accepted: 16646 DescriptionFarmer John wants to repair a small length of the fence around the pasture. He me

2017-07-22 11:26:40 485

原创 poj3481Double Queue之set解法

Double Queue Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15781 Accepted: 6993 DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Buc

2017-07-22 11:05:02 430

原创 poj 3253 优先队列

Fence Repair优先队列

2017-04-19 12:43:14 457

原创 poj2431 优先队列

ExpeditionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15540 Accepted: 4360DescriptionA group of cows grabbed a truck and ventured on an expedition d

2017-04-19 12:16:15 379

原创 poj2063 完全背包

InvestmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 10434 Accepted: 3668DescriptionJohn never knew he had a grand-uncle, until he received the not

2017-02-20 17:40:52 389

原创 POJ 3181Dollar Dayz

Dollar Dayz Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6735 Accepted: 2523 DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of t

2017-02-10 20:05:57 354

原创 01背包 poj2184

分析一:把其中一个属性值看做value,另一个看做weight,便成了01背包的变形设dp[j]为前i个cow放入容量为j的背包中所获取的最大weight,可以找到递推公式dp[j] = max(dp[j]+dp[j-value[i]]+weight[i]);分析二:在分析一的基础上,可以看成是求填满容量分别为0,1,.....的01背包所获得最大价值中的最大值

2017-02-10 13:02:26 268

原创 poj1384 Piggy-Bank 完全背包

Piggy-Bank Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11329 Accepted: 5495 DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial su

2017-02-10 12:23:02 807

原创 poj1837动态规划

BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 14035 Accepted: 8825DescriptionGigel has a strange "balance" and he wants to poise it. Actually,

2017-02-09 22:06:23 237

转载 最好用的 20 款数据可视化工具

转载网址:http://www.iteye.com/news/28093数据可视化可以让数据更加直观,为开发者做出正确决策奠定基础。本文将介绍20款不同的数据可视化工具,从简单列表到复杂表格,再到地图和信息图表。这些工具中大部分都是免费的,希望能够为你带来帮助。 一、入门级 首先,我们来看看你所熟知的工具,它们可能会有意想不到的用途。如果你是刚刚入门,那么首先要知道这些

2017-01-17 22:43:54 8014

原创 poj3624

Charm BraceletTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 34882 Accepted: 15440DescriptionBessie has gone to the mall's jewelry store and spies a ch

2016-12-05 23:00:06 1477

原创 poj3616 Miking Time dp

Milking TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8267 Accepted: 3454DescriptionBessie is such a hard-working cow. In fact, she is so focused

2016-10-18 12:15:55 305

原创 poj3280Cheapest Palindrome

Cheapest PalindromeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8864 Accepted: 4299DescriptionKeeping track of all the cows can be a tricky task so F

2016-10-18 12:04:23 277

原创 poj2385Apple Catching动归

Apple CatchingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11435 Accepted: 5514DescriptionIt is a little known fact that cows love apples. Farmer Joh

2016-10-12 21:28:25 613

原创 poj2229Sumsets递归/动态规划

SumsetsTime Limit: 2000MS Memory Limit: 200000KTotal Submissions: 17159 Accepted: 6760DescriptionFarmer John commanded his cows to search for different sets of nu

2016-10-12 21:21:22 376

原创 poj3176Cow Bowling

Cow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17897 Accepted: 11910DescriptionThe cows don't use actual bowling balls when they go bowling.

2016-10-11 20:22:07 350

原创 poj1328贪心

Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 76566 Accepted: 17139DescriptionAssume the coasting is an infinite straight line. Land

2016-08-11 21:49:24 471

原创 poj2376Cleaning Shifts_贪心

Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17935 Accepted: 4569DescriptionFarmer John is assigning some of his N (1 <= N <= 25,000)

2016-08-05 00:22:43 297

原创 poj3253Fence Repair解法之贪心

Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 39794 Accepted: 12979DescriptionFarmer John wants to repair a small length of the fence arou

2016-08-04 22:46:58 317

原创 poj3069贪心

Saruman's ArmyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7709 Accepted: 3941DescriptionSaruman the White must lead his army along a straight path

2016-08-04 20:19:58 315

原创 scanf("%c")和getchar

1.scanf("%c")scanf等待回车输入后,准确说是'\n'输入后,从缓冲区中读取数据,称为等待回车输入;这也是我们很多次输入数据要按回车键的原因。scanf读取数据时,简单来说分为两种一种是读取字符scanf("%c"),由于tab,空格,和回车都有自己对应的ascaii码,tab为9,空格为32,回车为10,所以输入数据时要谨防这些间隔符被当成字符输入;一种是输

2016-08-03 20:58:36 4664 2

原创 poj3617_简单贪心

Best Cow LineTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 18790 Accepted: 5228DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual

2016-08-03 20:04:42 379

原创 图的应用

从键盘或文件读入有向图的顶点信息和弧信息(输入格式自拟);建立有向图的十字链表存储结构;利用拓扑排序方法判断该图是否为有向无环图。#include #include #include #include #include #include #include #include #include #include #include #include #incl

2016-05-29 18:59:33 2485

原创 二叉树的应用

按照字典顺序构造一棵二叉排序树#include #include #include #include using namespace std;typedef struct node{ char key[20]; int w;} Retype;typedef struct Bsnode

2016-05-28 20:04:30 925

杀生丸图像

杀生丸高清图像,可以用来做数据分析、用神经网络提取杀生丸特征,自动画出杀生丸的图像。 更新:共有106张图像

2018-01-31

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除