上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 56 下一页
摘要: https://vjudge.net/problem/19685/origin 费马小定理优化快速幂 因为加了费马小定理优化,小心2 2 2这种情况,会出现0 0 2,也就是0的0次方,实际答案为0 阅读全文
posted @ 2019-08-02 00:15 WeiAR 阅读(98) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/problem/UVA-1230 费马小定理优化快速幂 阅读全文
posted @ 2019-08-01 22:47 WeiAR 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-08-01 17:25 WeiAR 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 打暴力找规律,都是连续自然数去掉一个 阅读全文
posted @ 2019-08-01 16:52 WeiAR 阅读(280) 评论(0) 推荐(0) 编辑
摘要: n=int(input()) ans=0 for i in range(1,n+1): t=1 for j in range(1,i+1): t*=j; ans+=t; print(ans) 阅读全文
posted @ 2019-08-01 11:40 WeiAR 阅读(154) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.org/problem/P1080 阅读全文
posted @ 2019-08-01 11:25 WeiAR 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 56 下一页