
ACM_数论
文章平均质量分 83
StanleyClinton
一个川大的弱弱的ACMER,加油整起走。
展开
-
解题报告 之 SOJ1678 Mountains
SOJ1678, Mountains,数论,递推,二分A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '\'. We call upwards and downwards together as wards. Let /n be an upward of length n, an原创 2015-05-09 01:24:04 · 605 阅读 · 0 评论 -
大数因数分解Pollard_rho 算法详解
大数因数分解 ,Pollard_rho,ACM,素数适用范围:给你一个大数n,将它分解它的质因子的乘积的形式。原创 2015-05-03 16:19:21 · 38550 阅读 · 9 评论 -
解题报告 之 NEFU84 五指山
解题报告 之 NEFU84 五指山五指山Problem : 84Time Limit : 1000msMemory Limit : 65536Kdescription西游记中孙吾空大闹天宫,如来佛祖前来降伏他,说道:原创 2015-05-06 15:34:44 · 954 阅读 · 0 评论 -
素数判定Miller_Rabin 算法详解
素数判定Miller_Rabin 算法详解上次说好的要把素数判定和大数分解(见另一篇博文)的快速随机化算法解决了,于是乎今天就来解决,不得不说理解起来真的有困难。我只能大概的将思路理一下,若有错漏还请担待。原创 2015-05-03 14:09:15 · 20799 阅读 · 3 评论 -
解题报告 之 POJ1061 青蛙的约会
POJ1061 ,青蛙的约会,数论,扩展欧几里德,最大公约数两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,你被要求写一个程序来判断这两只青蛙是否能够碰面,原创 2015-05-06 14:41:45 · 1344 阅读 · 0 评论 -
快速乘法/幂 算法详解
快速乘法 快速幂 算法详解数论,位运算适用范围:快速计算a*b % mod的结果,或者快速计算a^b % mod 的结果,时间复杂度大大降低。算法描述:首先你可能会问a*b不是直接乘就出来了么,为什么需要快速算法?但是乘法在计算机中处理的时间并不是这么快的,也要拆分为加法来做的。所以快速乘法会更快的计算a*b的结果。原创 2015-05-03 16:45:15 · 10473 阅读 · 8 评论 -
解题报告 之 SOJ1839 Relatives 欧拉函数 算法详解
SOJ1839 Relatives ,欧拉函数 ,素数筛,线性筛法,数论原创 2015-05-06 20:14:56 · 1072 阅读 · 0 评论 -
解题报告 之 SOJ1942 Foto
SOJ1942 ,Foto,数论,排列组合,快速排列组合The election campaign just started, so PSOS decided to make some propagation. One of the representatives came with a great idea - he proposes to make an photography of their Parliament Club. Unfortunatelly, even after many brie原创 2015-05-07 20:21:46 · 612 阅读 · 0 评论 -
解题报告 之 HDU5317 RGCDQ
解题报告 之 HDU5317 RGCDQDescription 筛法,数论,观察Mr. Hdu is interested in Greatest Common Divisor (GCD). He wants to find more and more interesting things about GCD. Today He comes up with Range Greatest Common Divisor Query (RGCDQ). What’s RGCDQ? Please let me原创 2015-08-23 10:53:15 · 856 阅读 · 0 评论 -
解题报告 之 POJ2891 Strange Way to Express Integers
POJ2891 ,Strange Way to Express Integers,线性同余方程组,数论Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choose k different positive integers a1, a2, …, ak. For so原创 2015-05-12 00:01:25 · 957 阅读 · 0 评论 -
解题报告 之 POJ1021 Fibonacci Again
解题报告 之 POJ1021 Fibonacci AgainPOJ1021 ,Fibonacci Again,数论,同余There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n原创 2015-05-11 12:31:09 · 915 阅读 · 0 评论 -
解题报告 之 SOJ2106 GCD & LCM Inverse
SOJ2106 ,GCD & LCM Inverse, 大数分解, pollard rho ,数论We are all familiar with the Euclid's algorithm. Given two positive integers a, b. we can easily find the greatest common divisor (GCD) and least common multiple (LCM) of a, b through this method. But what原创 2015-05-09 11:19:22 · 951 阅读 · 0 评论 -
解题报告 之 SOJ2714 Mountains(II)
SOJ1678, Mountains,数论,递推,二分A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '\'. We call upwards and downwards together as wards. Let /n be an upward of length n, an原创 2015-05-09 01:48:07 · 565 阅读 · 0 评论 -
解题报告 之 SOJ2668 C(n,k)
SOJ2668 ,C(n,k),素数的性质,数论 组合数奇偶性求组合数 C ( n , k) 的奇偶性原创 2015-05-09 02:48:12 · 811 阅读 · 0 评论 -
解题报告 之 SOJ2666 分解 n!
SOJ2666 分解 n!,数论,素数,ACM给你一个数 n (1 < n <= 1000000) ,求 n! (n的阶乘)的质因数分解形式,质因数分解形式为n=p1^m1*p2^m2*p3^m3……* 这里 p1 < p2 < p3 < …… 为质数* 如果 mi = 1, 则 ^ mi 就不需要输出原创 2015-05-09 03:27:16 · 909 阅读 · 0 评论 -
解题报告 之 HOJ2276 SOJ2498 Count prime
HOJ2276, SOJ2498 ,Count prime,区间素数筛,数论Given an integer interval [L, R](L <= R <= 2147483647, R - L <= 1000000), please calculate the number of prime(s) in the interval.原创 2015-05-10 00:50:44 · 624 阅读 · 0 评论 -
解题报告 之 SOJ3191 Free square
SOJ3191 ,Free square,容斥原理,二分,数论。A positive integer is said to be squarefree if it is divisible by no perfect square larger than 1. For example, the first few squarefree numbers are {1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, ...}. Can you tell me the原创 2015-05-10 11:43:25 · 647 阅读 · 0 评论 -
解题报告 之 POJ2769 Reduced ID Numbers
POJ2769 ,Reduced ID Numbers,数论,同余,ACMT. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxSIN = 10 6-1. T. Chur finds this原创 2015-05-11 12:18:36 · 895 阅读 · 0 评论 -
解题报告 之 HDU2035 人见人爱A^B
HDU2035 ,人见人爱A^B,数论,同余,ACM求A^B的最后三位数表示的整数。 说明:A^B的含义是“A的B次方”原创 2015-05-11 13:06:12 · 876 阅读 · 0 评论 -
解题报告 之 HDU5334 Virtual Participation
Description 构造,数论,数学As we know, Rikka is poor at math. Yuta is worrying about this situation, so he asks rikka to have some practice on codeforces. Then she opens the problem B: Given an integer , she needs to come up with an sequence of integers satis原创 2015-08-27 14:52:11 · 799 阅读 · 0 评论