自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 poj 2387 Til the Cows Come Home

题目链接思路:还是裸的dijkistra,可以拿来熟悉模板,读入的时候小心重边。#include#include#include#include#include#include#include#define INF 0x7ffffffusing namespace std;int a[1200][1200];int dis[1200];bool f[1200]

2016-03-15 21:31:16 248

原创 poj 1502 MPI Maelstrom

题目链接http://poj.org/problem?id=1502题目大意:求最短路,样例解释,给的是邻接矩阵的下半部分。思路:根据题目给的一半邻接矩阵构图,然后直接dijkstra即可,在根据题意输出最短路结果。#include#include#include#include#include#include#include#define INF 0x7ffff

2016-03-15 21:12:00 278

原创 poj 1328 Radar Installation

题目链接http://poj.org/problem?id=1328题目分析,阅读题意可以很明显的看出这是一道贪心的题目,但难点就是如何选用贪心方案。我的方法是(这个方法是错误的)按照纵坐标排序,然后依次放入雷达,然后验证能否有其他的未标记的点被当前雷达扫描到。能扫到,就标记一下,最后遍历完,计数一下雷达个数输出。正确的方法应该是,以每个点为圆心,雷达扫描范围为半径,做圆交x轴

2016-03-15 21:00:02 288

原创 poj 1125 Stockbroker Grapevine

题目链接:http://poj.org/problem?id=1125题目就是一个裸的floyd,没什么好解释的。。唯一需要注意一点的就是最后遍历查找结果的时候 i==j 时,直接跳过,不介入答案的更新#include#include#include#include#include#include#includeusing namespace std;int n;in

2016-03-15 19:28:12 265

原创 poj 1062 昂贵的聘礼

题目链接:http://poj.org/problem?id=1062这道题目不是自己独立做出来的,本来只是参考了部分题解,后来因为一些细节。。就把代码改的基本和题解一样了= =说一下思路:题目的难点主要就是等级制度和替换。只要将这个等级制度处理好,题目就可以变形成一个裸的dijkstra。处理等级制度,参考题解用在了构图上,即用物品做点,价钱作为边长。然后用dijkstra代换,

2016-03-15 19:21:06 303

原创 USACO [2.1] Sorting a Three-Valued Sequence

Sorting a Three-Valued Sequence IOI'96 - Day 2Sorting is one of the most frequently performed computational tasks.Consider the special sorting problem in which the records to be sortedhave at

2015-12-09 17:27:51 372

原创 USACO [2.1] Ordered Fractions

Ordered FractionsConsider the set of all reduced fractions between 0 and 1 inclusivewith denominators less than or equal to N.Here is the set when N = 5:0/1 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4

2015-12-09 15:58:49 398

原创 USACO[2.1]The Castle

IOI'94 - Day 1In a stroke of luck almost beyond imagination, Farmer John wassent a ticket to the Irish Sweepstakes (really a lottery) for hisbirthday. This ticket turned out to have only the winning

2015-12-08 21:36:24 325

空空如也

空空如也

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

TA关注的人

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