摘要: Gym100889Lhttps://vjudge.net/problem/341988/origin题目大意:有一个n*n的图,m条双向边(没有重边自环),求从每个节点出发走k条路后到其他所有节点的最短距离和方案数,方案数取模1e9+7输出做法:传递闭包,走k条路,就是做k次矩阵乘法,所谓矩阵乘法就 阅读全文
posted @ 2019-07-31 23:13 WeiAR 阅读(156) 评论(0) 推荐(0) 编辑
摘要: (g++比c++快不少 分治+矩阵快速幂 阅读全文
posted @ 2019-07-31 17:27 WeiAR 阅读(110) 评论(0) 推荐(0) 编辑
摘要: upper_bound1.temp=upper_bound(a+1,a+n+1,x)-b;temp表示在数组a中第一个大于x的位置 2.bool cmp(int a,int b){ return a>b;}temp=upper_bound(a+1,a+n+1,x,cmp)-b;temp表示在数组a中 阅读全文
posted @ 2019-07-31 16:09 WeiAR 阅读(108) 评论(0) 推荐(0) 编辑
摘要: lower_bound1.temp=lower_bound(a+1,a+n+1,x)-b;temp表示在数组a中第一个大于等于x的位置 2.bool cmp(int a,int b){ return a>b;}temp=lower_bound(a+1,a+n+1,x,cmp)-b;temp表示在数组 阅读全文
posted @ 2019-07-31 16:06 WeiAR 阅读(156) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/problem/Gym-102141E 用set乱搞 阅读全文
posted @ 2019-07-31 15:23 WeiAR 阅读(127) 评论(0) 推荐(0) 编辑