摘要: 定义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) 编辑
摘要: 暴力就行了,找出素因子,正的最多是30,然后负的最多是31(这一点wa了一次) #include <cstdio> #include <iostream> #include <ctime> #include <vector> #include <cmath> #include <map> #incl 阅读全文
posted @ 2016-04-13 10:39 shuguangzw 阅读(202) 评论(0) 推荐(0) 编辑