上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页
摘要: From:http://hi.baidu.com/aekdycoin/item/90065df1b0f5b412ce9f32d6Wiki:http://en.wikipedia.org/wiki/Dancing_Links论文参考:http://gaoyunxiang.com/wp-content/uploads/2010/02/Dancing_Links.pdfDancing Linkshttp://acm.hust.edu.cn/problem.php?id=1017过程:http://en.wikipedia.org/wiki/Algorithm_X模板题,测试模板的正确性。http:/ 阅读全文
posted @ 2012-12-29 00:32 zhang1107 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 参考资料:http://en.wikipedia.org/wiki/Gaussian_elimination习题集_From:这里http://poj.org/problem?id=3185http://poj.org/problem?id=2947http://poj.org/problem?id=1222 阅读全文
posted @ 2012-12-28 19:59 zhang1107 阅读(119) 评论(0) 推荐(0) 编辑
摘要: POJ2115 模线性方程View Code #include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef __int64 int64;int64 A,B,C,K;int64 p[35];void get_P() { p[0]=1; for(int i=1;i<33;i++) p[i]=p[i-1]*2;}int64 Extend_euc(int64 a,int64 b,int64&x,int 阅读全文
posted @ 2012-12-28 19:55 zhang1107 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.matrix67.com/blog/archives/276DNA Sequence 阅读全文
posted @ 2012-12-27 20:56 zhang1107 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 资料:http://en.wikipedia.org/wiki/Delaunay_triangulation#Algorithmshttp://poj.org/problem?id=2820 阅读全文
posted @ 2012-12-25 21:28 zhang1107 阅读(135) 评论(0) 推荐(0) 编辑
摘要: From:http://wenku.baidu.com/view/fa1a0fe79b89680203d82586.html讲解比较清楚的资料:http://blog.sina.com.cn/s/blog_6635898a0100on3q.htmlAC的数论总结:http://hi.baidu.com/aekdycoin/item/ec528c969cf7a230336eebaeC LooooopsA+CX=B (mod 2^K) 转化为CX=(A-B) (mod 2^K) 求一下模线性方程就好了。code:这里Strange Way to Express Integers模线性方程组的求解。 阅读全文
posted @ 2012-12-25 11:52 zhang1107 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Happy 2006容斥原理+分解素数因子View Code //POJ2773const int MM = 1100000;typedef __int64 int64;const int64 maxint = 0x3f3f3f3f;int64 N,M;bool isp[MM];int64 tp[MM],mm;int64 p[MM],cnt;void get_prime() { int64 i,j,k; memset(isp,true,sizeof(isp)); isp[0]=isp[1]=false; for(i=2;i<1005;i++) { ... 阅读全文
posted @ 2012-12-22 16:16 zhang1107 阅读(167) 评论(0) 推荐(0) 编辑
摘要: GCD求N以内和N最大公约数>=M的数的个数。求出N的所有约数x有N=p*x,当x>=M时,只是找出小于p且和p互质的数个数,欧拉函数。code:这里 阅读全文
posted @ 2012-12-22 00:29 zhang1107 阅读(114) 评论(0) 推荐(0) 编辑
摘要: How many integers can you find这个算是我容斥原理的第一道题目。没说实话,也不是什么特别难的题目,就是有点坑,居然有0这个数据。还有两个以上需要求最小公倍数。最简单的列子就是:24 2 3 6 {3 6 9 12 15 18 21},3和6重复计算的有6,12,18,而不是单单一个18虽然写的挫到爆,还是记录一下,code:这里 阅读全文
posted @ 2012-12-22 00:09 zhang1107 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 参考资料:http://wenku.baidu.com/view/5411f80a79563c1ec5da71af.htmlhttp://poj.org/problem?id=3270搞出排序后的序列和元数列的对应的置换,对于每个环可以通过最小元素作为中间变量交换,还有提取所有中最小的交换需要计算相应的权重。code:这里Double Dealing置换群,求出初始置换,回到e的最小的置换次数为拆分的所有循环的长度的最小公倍数。不过好像时间卡的很紧,以后注意尽量不要使用取摸运算。好像卡牌类的题目大多使用置换群。code:这里nanae is a good girl求出每个环的长度,贪心一下,一 阅读全文
posted @ 2012-12-21 20:20 zhang1107 阅读(146) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页