上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 60 下一页
摘要: 链接: https://www.acwing.com/problem/content/167/ 题意: 翰翰和达达饲养了N只小猫,这天,小猫们要去爬山。 经历了千辛万苦,小猫们终于爬上了山顶,但是疲倦的它们再也不想徒步走下山了(呜咕 _ using namespace std; typedef lo 阅读全文
posted @ 2019-09-17 01:02 YDDDD 阅读(171) 评论(0) 推荐(0)
摘要: 链接: https://www.acwing.com/problem/content/166/ 题意: 给定一张N个点M条边的有向无环图,分别统计从每个点出发能够到达的点的数量。 思路: 先拓扑排序求出顺序, 再通过bitset利用位运算,记录并集, 可以解决重复计算的问题. 代码: c++ inc 阅读全文
posted @ 2019-09-16 23:34 YDDDD 阅读(184) 评论(0) 推荐(0)
摘要: 链接: https://www.luogu.org/problem/P3810 submit 题意: 一个元素三个属性, x, y, z, 给定求f(b) = {ax using namespace std; const int MAXN = 2e5+10; struct Node { int x, 阅读全文
posted @ 2019-09-16 20:02 YDDDD 阅读(166) 评论(0) 推荐(0)
摘要: 链接: https://www.acwing.com/problem/content/254/ 题意: 给定一个有N个点(编号0,1,…,N 1)的树,每条边都有一个权值(不超过1000)。 树上两个节点x与y之间的路径长度就是路径上各条边的权值之和。 求长度不超过K的路径有多少条。 思路: 点分治 阅读全文
posted @ 2019-09-16 17:35 YDDDD 阅读(153) 评论(0) 推荐(0)
摘要: 链接: https://vjudge.net/problem/Gym 100741A 题意: Mathematicians are interesting (sometimes, I would say, even crazy) people. For example, my friend, a m 阅读全文
posted @ 2019-09-16 15:53 YDDDD 阅读(185) 评论(0) 推荐(0)
摘要: 链接: https://nanti.jisuanke.com/t/41402 题意: To seek candies for Maomao, Dudu comes to a maze. There are nn rooms numbered from 11 to nn and mm undirect 阅读全文
posted @ 2019-09-16 13:28 YDDDD 阅读(275) 评论(0) 推荐(0)
摘要: 链接: https://nanti.jisuanke.com/t/41403 题意: State Z is a underwater kingdom of the Atlantic Ocean. This country is amazing. There are nn cities in the 阅读全文
posted @ 2019-09-15 16:42 YDDDD 阅读(316) 评论(0) 推荐(0)
摘要: 平衡树 Treap实现 思路: 利用堆的性质, 让二叉搜索数满足堆的性质,从而达到logn的高度. 模板 具体解释看注释,注释也不多(逃) 代码: c++ / 平衡数Treap模板 Treap 可以理解为一棵树加上一个堆, 通过对每个节点赋予一个随机值 在满足堆的性质的同时满足二叉搜索树的性质, 保 阅读全文
posted @ 2019-09-13 17:40 YDDDD 阅读(227) 评论(0) 推荐(0)
摘要: 链接: https://www.acwing.com/problem/content/description/286/ 题意: 虽然探索金字塔是极其老套的剧情,但是有一队探险家还是到了某金字塔脚下。 经过多年的研究,科学家对这座金字塔的内部结构已经有所了解。 首先,金字塔由若干房间组成,房间之间连有 阅读全文
posted @ 2019-09-13 10:38 YDDDD 阅读(155) 评论(0) 推荐(0)
摘要: 链接: https://www.acwing.com/problem/content/285/ 题意: “多边形游戏”是一款单人益智游戏。 游戏开始时,给定玩家一个具有N个顶点N条边(编号1 N)的多边形,如图1所示,其中N = 4。 每个顶点上写有一个整数,每个边上标有一个运算符+(加号)或运算符 阅读全文
posted @ 2019-09-11 23:30 YDDDD 阅读(197) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 60 下一页