上一页 1 2 3 4 5 6 7 8 9 10 ··· 29 下一页
摘要: 题目:有一个地图,一个人从某个点出发,问走到花园的期望步数为多少设某点的期望步数为Ei。那么目标的Ei=0。Ei=(Enext1+Enext2……Enextk)/k+1。为什么是这个公式 因为 如果 Ei-1的期望应该等于所有从Ei出发的点的期望总和bfs完 套一个高斯消元就ok了#include ... 阅读全文
posted @ 2015-09-14 15:51 来自大山深处的菜鸟 阅读(260) 评论(0) 推荐(0) 编辑
摘要: Lele now is thinking about a simple function f(x).If x = 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10);And ai(0#include #inclu... 阅读全文
posted @ 2015-09-14 14:28 来自大山深处的菜鸟 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 给了一个01矩阵然后选在一个点1变0或者0变1 然后 与他相邻的 数也相应的变成相反的数,问最后求出一种方案把他们变成全0将每一个位置上的状态看做一个变元,30个变元,列出30个异或方程#include #include #include #include #include using namesp... 阅读全文
posted @ 2015-09-14 13:27 来自大山深处的菜鸟 阅读(132) 评论(0) 推荐(0) 编辑
摘要: A#include #include#include #include #include using namespace std;struct point{ int x,p; bool operator 0){ loc=i;break; } ... 阅读全文
posted @ 2015-09-12 11:48 来自大山深处的菜鸟 阅读(208) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/firenet1/article/details/47041145#include #include #include #include #include #include using namespace std;const int maxn=500100;... 阅读全文
posted @ 2015-09-11 15:12 来自大山深处的菜鸟 阅读(176) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/mowayao/article/details/38875021题意: 5000组样例。 问你[1,n] 和 [1,m]中有多少对数的GCD的素因子个数小于p。思路:首先考虑一个相对简单的版本: [1,a] 和 [1,b] 有多少对的数 满足GCD #inc... 阅读全文
posted @ 2015-09-10 16:37 来自大山深处的菜鸟 阅读(169) 评论(0) 推荐(0) 编辑
摘要: hdu 1695莫比乌斯反演给出a,b,c,d,k, 求满足a #include #include #include #include using namespace std;const int maxn=1000005;bool check[maxn];int mu[maxn];int prime... 阅读全文
posted @ 2015-09-10 10:52 来自大山深处的菜鸟 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 这题说的找出一个数组串 3等分 第一个部分和第3个部分一样,第二个部分和第一个部分回文,那么计算出这些字符串问这样的字符串最长为多少,我们先使用manacher 计算出每个位置以他为对称轴左边端点的最长回文半径 加入第i个位置 回文半径为 d[i],那么他能影响的范围为d[i]-i至i 如果他是那个... 阅读全文
posted @ 2015-09-09 17:02 来自大山深处的菜鸟 阅读(215) 评论(0) 推荐(0) 编辑
摘要: E. Gerald and Giant Chesstime limit per test2 secondsmemory limit per test256 megabytes2015-09-09inputstandard inputoutputstandard outputGiant chess i... 阅读全文
posted @ 2015-09-09 11:36 来自大山深处的菜鸟 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 题意 : 给了n课不同的树,要求将 0,1,2,3,4,5,...m个松果,分别放在n棵树上的方案数有多少,我们这样考虑, 如果将m个相同的松果 放入n棵树中 , 转化一下,我们让每个点至少放1个松果,将 摆成 一行 n+m 个 ,然后 n+m 中间会有n+m-1个空格 加末尾一个就说明有 n+m个... 阅读全文
posted @ 2015-09-09 10:54 来自大山深处的菜鸟 阅读(275) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 29 下一页