上一页 1 2 3 4 5 6 ··· 8 下一页
  2016年3月2日
摘要: http://poj.org/problem?id=3292 题意:H-number: 所有4的倍数加1 如 1 5 9 13..... H-prime: 因子除了1,没有其他因子为H-number H-semi-prime: 只能拆成两个 H-prime的乘积,方案可以有多种,但只能拆成两个。 筛 阅读全文
posted @ 2016-03-02 20:57 Yesphet 阅读(141) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2891 解线性模方程组。 比较坑爹,数据比较大,很容易溢出。 1 Program poj2891; 2 3 var m:int64; 4 5 a,r:array[1..30000000]of int64; 6 7 ans,x,y,lcm:int6 阅读全文
posted @ 2016-03-02 20:56 Yesphet 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 比较愚钝,一点点数论花了好长时间才弄明白,小小总结下。 ①最大公约数 (辗转相除法) Function gcd(a,b:longint):longint; begin if b=0 then gcd:=a else gcd:=gcd(b,a mod b); end; ②最小公倍数 lcm(a,b)* 阅读全文
posted @ 2016-03-02 20:56 Yesphet 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1 Program poj2112; 2 3 var n,c,m,mid,s,t:longint; 4 5 map,a:array[1..300,1..300]of longint; 6 7 cur,dis:array[1..300]of longint; 8 9 vh:array[0..300]o 阅读全文
posted @ 2016-03-02 20:55 Yesphet 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Program poj1698; const fiftyweeks=350; type cord=record po,da,ne:longint; end; var tt,i,n,le,s,t,flow,tot:longint; a:array[1..9]of longint; head:array 阅读全文
posted @ 2016-03-02 20:54 Yesphet 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Program poj1274; var n,m,s,t,flow:longint; map:array[1..500,1..500]of longint; cur,dis:array[1..500]of longint; vh:array[0..500]of longint; Procedure  阅读全文
posted @ 2016-03-02 20:54 Yesphet 阅读(114) 评论(0) 推荐(0) 编辑
摘要: http://162.105.81.212/JudgeOnline/problem?id=3461 1 Program stone; 2 var i,j,k,n,ans:longint; 3 w,s:ansistring; 4 b:array[1..10000]of longint; 5 Begin 阅读全文
posted @ 2016-03-02 20:53 Yesphet 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 最近练搜索,就哈希有点想法,所以边思考边记录一下。 哈 希是为了加快速度,减少时间复杂度,所以一个高效的哈希函数对程序非常重要。而高效的哈希函数是什么?就是很少乃至没有冲突,编码复杂度低。什么是编码, 就是将我们所要存储的信息,有可能是一个数,一个矩阵等等编成一个数,让不同信息所生成的数尽量不同也就 阅读全文
posted @ 2016-03-02 20:52 Yesphet 阅读(167) 评论(0) 推荐(0) 编辑
摘要: http://www.zybbs.org/JudgeOnline/problem.php?id=2313 _______________________________________________ 对于n要求方案数: 对于n的约数s,即将n个数分为s组,每组有n/s=p个数共有: ans (p) 阅读全文
posted @ 2016-03-02 20:51 Yesphet 阅读(316) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2115 _______________________________________ 求 a+cx=b (mod 2^k) 用exgcd求线性模方程! _______________________________________ 1 Prog 阅读全文
posted @ 2016-03-02 20:50 Yesphet 阅读(98) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页