Evanyou Blog 彩带
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: "传送门" include include include include include define re register using namespace std; const int maxn = 2005; const int maxm = 3005; inline int read(){ 阅读全文
posted @ 2018-11-08 20:10 Stephen_F 阅读(100) 评论(0) 推荐(0) 编辑
摘要: "传送门" 有向图。。 代码中有两种方法,拓扑排序和记忆化搜索 include include include include include define re register using namespace std ; const int maxn = 1e5 + 4 ; inline int 阅读全文
posted @ 2018-11-08 19:35 Stephen_F 阅读(110) 评论(0) 推荐(0) 编辑
摘要: "传送门" 思路分析 怎么求解呢? 其实我们可以把左边的式子当成一个算式来计算,从1到 $ m $ 枚举,只要结果是0,那么当前枚举到的值就是这个等式的解了。可以通过编写一个 $ bool $ 函数来判断算式的值是不是0 至于如何计算这个多项式,用秦九韶算法就可以解决 细节提示 : 1.防爆 $ i 阅读全文
posted @ 2018-11-08 18:16 Stephen_F 阅读(107) 评论(0) 推荐(0) 编辑
摘要: "传送门啦" include include include include define re register using namespace std; const int maxn = 5005; const int maxm = 200005; inline int read(){ char 阅读全文
posted @ 2018-11-08 17:26 Stephen_F 阅读(124) 评论(0) 推荐(0) 编辑
摘要: "传送门啦" 阅读全文
posted @ 2018-11-08 17:25 Stephen_F 阅读(128) 评论(0) 推荐(0) 编辑
摘要: "传送门啦" 这道题的特殊之处在于对于任意一个并查集,只要告诉你某个节点的物种,你就可以知道所有节点对应的物种。 比如一条长为4的链 甲 乙 丙 丁 ,我们知道乙是A物种。那么甲一定是B物种,因为A只吃B物种,不吃C物种或是自己的同类。同样的丙一定是C物种,丁是B物种。 也就是说,每一条链上都是A、 阅读全文
posted @ 2018-11-08 17:03 Stephen_F 阅读(126) 评论(0) 推荐(0) 编辑
摘要: "传送门啦" 要求的就是,把树上的一条边的权值设为0之后,所有路径中的最大值的最小值。 首先二分最大值,假设某次二分的最大值为x,我们首先找出所有大于x的路径(也就是我们需要通过改权缩短的路径),并把路径上的所有边都标记一下。 在标记完成后,枚举所有边,如果存在一条边位于所有长度大于于x的路径上,并 阅读全文
posted @ 2018-11-08 16:03 Stephen_F 阅读(161) 评论(0) 推荐(0) 编辑
摘要: "传送门啦" 倍增 $ Floyd $ 注意结构体里二维数组不能开到 $ 2000 $ include include include include define Re register using namespace std; inline int read(){ char ch = getch 阅读全文
posted @ 2018-11-08 16:00 Stephen_F 阅读(162) 评论(0) 推荐(0) 编辑
摘要: "传送门啦" 题目中有一个条件是路径上的所有点的出边所指向的点都直接或间接与终点连通。 所以我们要先判断能否走这一个点, $ bfs $ 类似 $ spfa $ 的一个判断,打上标记。 在这我反向建图,最后跑最短路的时候就从终点跑到起点,也是一样的。在最短路中加上一个判断就好了。 include i 阅读全文
posted @ 2018-11-07 20:47 Stephen_F 阅读(95) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2018-11-06 16:49 Stephen_F 阅读(3) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页