会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
itdef
上一页
1
···
81
82
83
84
85
86
87
88
89
···
127
下一页
2019年12月17日
acwing 851. spfa求最短路 模板
摘要: 地址 https://www.acwing.com/problem/content/description/853/ 给定一个n个点m条边的有向图,图中可能存在重边和自环, 边权可能为负数。 请你求出1号点到n号点的最短距离,如果无法从1号点走到n号点,则输出impossible。 数据保证不存在负
阅读全文
posted @ 2019-12-17 14:38 itdef
阅读(269)
评论(0)
推荐(0)
acwing 853. 有边数限制的最短路 模板
摘要: 地址 https://www.acwing.com/problem/content/description/855/ 给定一个n个点m条边的有向图,图中可能存在重边和自环, 边权可能为负数。 请你求出从1号点到n号点的最多经过k条边的最短距离,如果无法从1号点走到n号点,输出impossible。
阅读全文
posted @ 2019-12-17 11:56 itdef
阅读(256)
评论(0)
推荐(0)
2019年12月16日
acwing 850. Dijkstra求最短路 II 模板
摘要: 地址 https://www.acwing.com/problem/content/description/852/ 这里相比上一篇 Dijkstra模板 使用了堆记录点距离 从而节省了查找最短距离的开销
阅读全文
posted @ 2019-12-16 18:35 itdef
阅读(403)
评论(0)
推荐(0)
acwing 849 Dijkstra求最短路 I 模板
摘要: 地址 https://www.acwing.com/problem/content/description/851/ 给定一个n个点m条边的有向图,图中可能存在重边和自环,所有边权均为正值。 请你求出1号点到n号点的最短距离,如果无法从1号点走到n号点,则输出-1。 输入格式 第一行包含整数n和m。
阅读全文
posted @ 2019-12-16 16:59 itdef
阅读(435)
评论(0)
推荐(0)
2019年12月15日
LeetCode 1289 下降路径最小和 II Minimum Falling Path Sum II
摘要: 地址 https://leetcode-cn.com/contest/biweekly-contest-15/problems/minimum-falling-path-sum-ii/ 题目描述给你一个整数方阵 arr ,定义「非零偏移下降路径」为:从 arr 数组中的每一行选择一个数字,且按顺序选
阅读全文
posted @ 2019-12-15 00:24 itdef
阅读(308)
评论(0)
推荐(0)
LeetCode 1288. 删除被覆盖区间 Remove Covered Intervals
摘要: 地址 https://leetcode-cn.com/contest/biweekly-contest-15/problems/remove-covered-intervals/ 目描述给你一个区间列表,请你删除列表中被其他区间所覆盖的区间。 只有当 c <= a 且 b <= d 时,我们才认为区
阅读全文
posted @ 2019-12-15 00:23 itdef
阅读(422)
评论(0)
推荐(0)
LeetCode 1287. 有序数组中出现次数超过25%的元素 Element Appearing More Than 25% In Sorted Array
摘要: 地址 https://leetcode-cn.com/contest/biweekly-contest-15/problems/element-appearing-more-than-25-in-sorted-array/ 目描述给你一个非递减的 有序 整数数组,已知这个数组中恰好有一个整数,它的出
阅读全文
posted @ 2019-12-15 00:21 itdef
阅读(300)
评论(0)
推荐(1)
LeetCode 1286. 字母组合迭代器 Iterator for Combination
摘要: 地址 https://leetcode-cn.com/contest/biweekly-contest-15/problems/iterator-for-combination/ 题目描述请你设计一个迭代器类,包括以下内容: 一个构造函数,输入参数包括:一个 有序且字符唯一 的字符串 charact
阅读全文
posted @ 2019-12-15 00:19 itdef
阅读(417)
评论(0)
推荐(0)
2019年12月12日
poj 3468 A Simple Problem with Integers 线段树 题解《挑战程序设计竞赛》
摘要: 地址 http://poj.org/problem?id=3468 线段树模板 要背下此模板 1 #include <iostream> 2 #include <vector> 3 #include <math.h> 4 #include <algorithm> 5 6 7 using namesp
阅读全文
posted @ 2019-12-12 17:10 itdef
阅读(406)
评论(0)
推荐(0)
poj 2456 Aggressive cows 二分 题解《挑战程序设计竞赛》
摘要: 地址 http://poj.org/problem?id=2456 解法 使用二分逐个尝试间隔距离 能否满足要求 检验是否满足要求的函数 使用的思想是贪心 第一个点放一头牛 后面大于等于尝试的距离才放置一头牛 如果能放置完所有的牛 那么就继续增加尝试的距离 否则就减少尝试的距离 代码 1 #incl
阅读全文
posted @ 2019-12-12 14:23 itdef
阅读(324)
评论(0)
推荐(0)
上一页
1
···
81
82
83
84
85
86
87
88
89
···
127
下一页
导航
博客园
首页
新随笔
联系
订阅
管理
公告