上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页
摘要: Description Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bam 阅读全文
posted @ 2016-08-03 20:12 邻家那小孩儿 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 一、费马小定理 假如 a 是一个整数,p 是一个质数,那么是 p 的倍数,则可以表示为 eg : if a = 2 and p = 7, 27 = 128, and 128 − 2 = 7 × 18 is an integer multiple of 7. 如果 a 不是 p 的倍数,则定理还可以表 阅读全文
posted @ 2016-08-03 15:49 邻家那小孩儿 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 设正整数两两互素,则同余方程组 存在整数解,并且在模下的解是唯一的,解为 其中,而为模的逆元。 阅读全文
posted @ 2016-08-02 18:58 邻家那小孩儿 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 欧拉函数是小于等于n的数中与n互质的数的数目; 通式: 其中p1,p2....pn为xd的所有质因数,x是不为0的整数, *注意 : 每种质因数只有一个。 比如 12=2*2*3; 那么 φ(12)=12*(1-1/2)*(1-1/3)=4 φ(1)=1 (唯一和 1 互质的书(小于等于1) 就是 阅读全文
posted @ 2016-08-02 18:33 邻家那小孩儿 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 一、欧几里得算法 二、扩展欧几里得算法 对于不完全为 0 的非负整数 a,b,gcd(a,b)表示 a,b 的最大公约数,必然存在整数对 x,y ,使得 gcd(a,b)=ax+by。 可见,扩展欧几里德要求a,b,不能为负,所以当出现负数时我们通常采用 |a|(-x)+by=gcd(|a|,b) 阅读全文
posted @ 2016-08-02 10:32 邻家那小孩儿 阅读(185) 评论(0) 推荐(0) 编辑
摘要: //平分硬币问题 //对sum/2进行01背包,sum-2*dp[sum/2] 阅读全文
posted @ 2016-07-02 14:50 邻家那小孩儿 阅读(99) 评论(0) 推荐(0) 编辑
摘要: //路径记录方法:若是dp[j-value[i]]+value[i]>dp[j]说明拿了这个东西,标志为1, //for循环标志,发现是1,就打印出来,并把背包的容量减少,再在次容量中寻找标志; 阅读全文
posted @ 2016-07-02 11:24 邻家那小孩儿 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. 阅读全文
posted @ 2016-06-26 16:19 邻家那小孩儿 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Description You must have heard that the Chinese culture is quite different from that of Europe or Russia. So some Chinese habits seem quite unusual o 阅读全文
posted @ 2016-06-22 20:56 邻家那小孩儿 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Description Berland has n cities connected by m bidirectional roads. No road connects a city to itself, and each pair of cities is connected by no mor 阅读全文
posted @ 2016-06-06 20:38 邻家那小孩儿 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页