会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Dazzling
外婆坐在阳光下 轻轻抚着我的发 那远去的少年 恍然间长大
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
54
55
56
57
58
59
60
61
62
···
67
下一页
2020年12月2日
NC22594 Rinne Loves Graph
摘要: 分层图最短路,注意按照题意中的“穿过”的定义来模拟。 const int N=1e5+10; struct Node { int dis; int u,cnt; bool operator>(const Node &W) const { return dis>W.dis; } }; vector<P
阅读全文
posted @ 2020-12-02 23:25 Dazzling!
阅读(102)
评论(0)
推荐(0)
2020年11月24日
L2-001 紧急救援 (25分)
摘要: 最短路计数+最短路径下的最大点权和+路径输出 const int N=510; vector<PII> g[N]; int p[N]; int dist[N]; bool vis[N]; int cnt[N]; int save[N]; int pre[N]; int n,m; int st,ed;
阅读全文
posted @ 2020-11-24 11:28 Dazzling!
阅读(294)
评论(0)
推荐(0)
P1608 路径统计
摘要: $dijkstra$最短路径计数,注意判输入时的重复数据(=_=) const int N=2010; struct Node { int a,b,c; bool operator<(const Node &W) const { if(a == W.a) { if(b == W.b) return
阅读全文
posted @ 2020-11-24 10:38 Dazzling!
阅读(99)
评论(0)
推荐(0)
2020年10月23日
NC26257 小雨坐地铁
摘要: 比较裸的拆点最短路吧 注意特判起点终点相等的情况,起点终点相等不需要换乘任何线路,答案为0 const int N=1010,M=510; struct Node { int u,line,dis; bool operator>(const Node &W) const { return dis>W
阅读全文
posted @ 2020-10-23 10:32 Dazzling!
阅读(133)
评论(0)
推荐(0)
2020年10月10日
NC17509 挖沟
摘要: $MST$板子题 const int N=5e5+10; struct Node { int a,b,c; bool operator<(const Node &W) const { return c<W.c; } }e[N]; int p[N]; int n,m; int find(int x)
阅读全文
posted @ 2020-10-10 23:07 Dazzling!
阅读(88)
评论(0)
推荐(0)
POJ 1797 Heavy Transportation
摘要: dijkstra $dijkstra$求最短路中我们每次选取的是离原点的最短边来松弛剩下的节点 在这里我们要找到到达终点的的一条路使其路径上的最小边尽量大,才能使其载重量较大。 也就是说每次选择一个从源点到某个载重量最大的点,来松弛其他点。 $dist$将记录到达每个点的路径上的最小载重,选择最大的
阅读全文
posted @ 2020-10-10 17:57 Dazzling!
阅读(97)
评论(0)
推荐(0)
P4568 [JLOI2011]飞行路线
摘要: 同追债之旅 分层图最短路 每次的决策:用/不用免费票 const int N=10010; vector<PII> g[N]; struct Node { int dis,u,cnt; bool operator>(const Node &W) const { return dis>W.dis; }
阅读全文
posted @ 2020-10-10 11:56 Dazzling!
阅读(95)
评论(0)
推荐(0)
※NC14700 追债之旅
摘要: 最短路变形题,加一维状态就好啦 $dist[i][j]$表示到达第$i$号点,到达时间为第$j$天的最短距离 判重数组要和$dist$数组一致 直接跑$dijkstra$即可 const int N=1010; vector<PII> g[N]; struct Node { int dis,u,da
阅读全文
posted @ 2020-10-10 11:36 Dazzling!
阅读(104)
评论(0)
推荐(0)
2020年10月4日
P2323 [HNOI2006]公路修建问题
摘要: \(update\) 如果按照正确理解题意的情况下, 好多题解的代码都错的啊,但毕竟十几年前的题了,数据水了 二分 一眼二分 最后输出答案前一定要$check$一遍最优解,才能得到正确的方案 const int N=10010,M=20010; struct Edge { int a,b,c; }e
阅读全文
posted @ 2020-10-04 22:04 Dazzling!
阅读(103)
评论(0)
推荐(0)
※NC14550 旅行
摘要: 太菜了。。。这么简单的模型都看不出来。。。 模型:图的直径 注意:原题为无向图 暴力思路:从$1000$个点中选取$3$个点的排列,然后求路径和。 上述思路过于暴力,我们知道$dijkstra$算法求得的$dist$数组是源点$s$到其余点的最短距离 我们只需将源点看成中转点,然后求出当前点到其余点
阅读全文
posted @ 2020-10-04 20:22 Dazzling!
阅读(117)
评论(0)
推荐(0)
上一页
1
···
54
55
56
57
58
59
60
61
62
···
67
下一页
公告