上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 30 下一页
摘要: 上面是官方题解,写的很好,然后就A了,就是找到前缀和相等的最多区间,这样就可以减去更多的1 然后肯定很多人肯定很奇怪为什么从1开始数,其实从2开始也一样,因为是个环,从哪里开始记录前缀和都一样 我们的目的是为了找到更多的区间和为0,从哪开始都一样,只是一个标准罢了 #include <cstdio> 阅读全文
posted @ 2016-05-26 22:04 shuguangzw 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 分析:一个n*m的矩阵,每个格子有12个状态,每次按一次,每个格子转90度,所以整个矩阵只有4种状态,然后爆搜就好了 #include <cstdio> #include <iostream> #include <algorithm> #include <string.h> #include <st 阅读全文
posted @ 2016-05-26 12:11 shuguangzw 阅读(270) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/angon823/article/details/51484906 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <cmath> 阅读全文
posted @ 2016-05-25 21:30 shuguangzw 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 和上一题一样,把平方因子除去,然后对应的数就变成固定的 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; c 阅读全文
posted @ 2016-05-25 18:00 shuguangzw 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 把所有数的立方因子除去,那么一个数可以和它组成立方的数是确定的,统计就行 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <cmath> using namespace st 阅读全文
posted @ 2016-05-25 17:56 shuguangzw 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 转自:http://blog.csdn.net/jtjy568805874/article/details/51480479 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using nam 阅读全文
posted @ 2016-05-24 23:08 shuguangzw 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 分析:一棵以1为根的有根树,然后每个点维护从根到当前节点的路径和,当修改一个点时 只会影响的子树的和,最优值也是子树最大的值 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> using nam 阅读全文
posted @ 2016-05-24 22:39 shuguangzw 阅读(168) 评论(0) 推荐(0) 编辑
摘要: dp[i][j][k]代表到第i个位置,第i个位置是j,k为已经选了i个数分别是那些(2进制状压) 然后:其实真正有用的状态很少,可以写记忆化搜索,我写的BFS加速 #include <iostream> #include <cstdio> #include <cstdlib> #include < 阅读全文
posted @ 2016-05-23 22:46 shuguangzw 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 分析:暴力找循环节就好了 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <string> #include <stack> #include 阅读全文
posted @ 2016-05-23 22:40 shuguangzw 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 分析:就是给一些拓补关系,然后求最大分数,所以贪心,大的越靠前越好,小的越靠后越好 剩下的就是toposort,当然由于贪心,所以使用优先队列 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #i 阅读全文
posted @ 2016-05-23 22:34 shuguangzw 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 30 下一页