上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 30 下一页
摘要: 官方题解: 观察递推式我们可以发现,所有的fi​​都是a的幂次,所以我们可以对f​i​​取一个以a为底的log,g​i​​=log​a​​ f​i​​ 那么递推式变g​i​​=b+c∗g​i−1​​+g​i−2​​,这个式子可以矩阵乘法 这题有一个小trick,注意a mod p=0的情况. 分析: 阅读全文
posted @ 2016-04-17 10:46 shuguangzw 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 这个题和一个CF上的找"Z"的题差不多,都是扫描线+树状数组 从右上角的主对角线开始扫描,一直扫到左下角,每次更新,右延伸等于该扫描线的点,注意在其所在的树状数组更新就好了 时间复杂度O(n^2logn) #include <stdio.h> #include <iostream> #include 阅读全文
posted @ 2016-04-17 10:37 shuguangzw 阅读(207) 评论(0) 推荐(0) 编辑
摘要: LRJ白书上的题 #include <stdio.h> #include <iostream> #include <vector> #include <math.h> #include <set> #include <map> #include <queue> #include <algorithm 阅读全文
posted @ 2016-04-15 23:19 shuguangzw 阅读(199) 评论(0) 推荐(0) 编辑
摘要: lrj白书例题,真好 #include <stdio.h> #include <iostream> #include <vector> #include <math.h> #include <set> #include <queue> #include <algorithm> #include <s 阅读全文
posted @ 2016-04-15 15:27 shuguangzw 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 定义dp[t][x1][y1][x2][y2]为在t时刻,人走到x1,y1,影子走到x2,y2所获得最大价值 最终就是所有的dp[max][..][..][..][..]的最大值 然后递推也很自然,枚举人和影子的动向,唯一注意的是当走到一点时,只获得一次价值,要除以2 然后对于每一层时间,其实有效的 阅读全文
posted @ 2016-04-13 21:52 shuguangzw 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 分析:floyd看似很好理解,实际上是状态转移,具体的解释参照这里 http://www.cnblogs.com/chenying99/p/3932877.html 深入理解了floyd后,这个题就可做了 首先,枚举最短路径的最大点,k,然后由于floyd的更新性质,更新到k时, 数组中存的是“只能 阅读全文
posted @ 2016-04-13 20:29 shuguangzw 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 分析:枚举每个数的贡献,欧拉函数筛法 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #include <queue> #include 阅读全文
posted @ 2016-04-13 18:30 shuguangzw 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 就是统计5,然后当时因为发现最多有8000w个5的倍数,然后8000w/100,是80w,打表,二分找 然后我看网上的都是直接二分找,真是厉害 #include <cstdio> #include <iostream> #include <ctime> #include <vector> #incl 阅读全文
posted @ 2016-04-13 15:31 shuguangzw 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题意:筛一段区间内素数的个数,区间宽度10w,区间范围INT_MAX 分析:用sqrt(INT_MAX筛一遍即可),注意先筛下界,再筛上届,因为有可能包含 #include <cstdio> #include <iostream> #include <ctime> #include <vector> 阅读全文
posted @ 2016-04-13 14:43 shuguangzw 阅读(164) 评论(0) 推荐(0) 编辑
摘要: java有大数模板 import java.util.Scanner; import java.math.*; public class Main { public static void main(String[] args) { Scanner cin =new Scanner(System.i 阅读全文
posted @ 2016-04-13 10:56 shuguangzw 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 30 下一页