ACM--数论专题
ACM对各大oj中数论经典题目的总结和归纳,以及经验交流。
寻找星空的孩子
CSDN博客首页:http://blog.csdn.net/u010579068?viewmode=list
博客园地址:http://www.cnblogs.com/yuyixingkong/
展开
-
hdu 1568 (log取对数 / Fib数通项公式)
hdu 1568 (log取对数 / Fib数通项公式)2007年到来了。经过2006年一年的修炼,数学神童zouyu终于把0到100000000的Fibonacci数列(f[0]=0,f[1]=1;f[i] = f[i-1]+f[i-2](i>=2))的值全部给背了下来。接下来,CodeStar决定要考考他,于是每问他一个数字,他就要把答案说出来,不过有的数字太长了。所以转载 2014-03-09 17:44:50 · 1163 阅读 · 0 评论 -
线性递推关系与矩阵乘法
对于一般的具有常系数线性递推关系的递推数列,若需要很快算出某一项的精确值,一般的方法是求出特征方程的解然后解出这个递推关系的通项公式。可是随着递推关系阶数的升高,解特征方程的难度也逐渐增大,甚至在递推关系阶数大于 5 之后,特征方程的次数随之超过 5,根本没有代数解法。本文利用矩阵乘法,提出了一个在 O(k^3 ⌈logn⌈) 的时间复杂度内算出 k 阶常系数线性递推数列第 n 项的精确值的算法,并利用转移矩阵和特征方程的联系,把这个算法的时间复杂度优化到了 O(k^2 ⌈logn⌉).原创 2015-02-08 15:37:15 · 3481 阅读 · 0 评论 -
Number Sequence(hdu4390)
Number SequenceTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 895 Accepted Submission(s): 374Problem DescriptionGiven a number sequenc原创 2015-03-23 11:28:47 · 555 阅读 · 0 评论 -
A simple problem(湘大邀请赛)
A simple problemProblem DescriptionThere is a simple problem. Given a number N. you are going to calculate N%1+N%2+N%3+...+N%N.原创 2015-03-23 11:28:49 · 1059 阅读 · 0 评论 -
Lifting the Stone(hdu1115)多边形的重心
Lifting the StoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5370 Accepted Submission(s): 2239Problem DescriptionThere are many secr原创 2015-03-23 11:28:54 · 604 阅读 · 0 评论 -
Herding(hdu4709)三点运用行列式求面积
HerdingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1553 Accepted Submission(s): 440Problem DescriptionLittle John is herding his fat原创 2015-03-23 11:28:58 · 805 阅读 · 0 评论 -
Quoit Design(hdu1007)最近点对问题。模版哦!
Quoit DesignTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30919 Accepted Submission(s): 8120Problem DescriptionHave you ever played q原创 2015-03-23 11:29:02 · 712 阅读 · 0 评论 -
Incircle and Circumcircle(二分+几何)浙大月赛zoj3806(详解版)图
Incircle and CircumcircleTime Limit: 2 Seconds Memory Limit: 65536 KB Special JudgeA triangle is one the basic shapes in geometry. It's a polygon with three vertices and three sides which are line s原创 2015-03-23 11:30:05 · 973 阅读 · 0 评论 -
M斐波那契数列(矩阵快速幂+费马小定理)
M斐波那契数列Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1672 Accepted Submission(s): 482Problem DescriptionM斐波那契数列F[n]是一种整数数列,它的定义如下:F[0原创 2015-03-23 11:32:36 · 1260 阅读 · 0 评论 -
233 Matrix(hdu5015 矩阵)
233 MatrixTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1190 Accepted Submission(s): 700Problem DescriptionIn our daily life we ofte原创 2015-03-23 11:32:51 · 758 阅读 · 0 评论 -
青蛙的约会(poj1061+欧几里德+同余方程)
**青蛙的约会**Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 94174 Accepted: 17412 Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要原创 2015-03-27 19:34:24 · 4734 阅读 · 1 评论 -
Cylinder Candy(积分+旋转体)
Cylinder CandyTime Limit: 2 Seconds Memory Limit: 65536 KB Special JudgeEdward the confectioner is making a new batch of chocolate covered candy. Each candy center is shaped as a cylinde原创 2015-04-16 21:54:11 · 1301 阅读 · 0 评论 -
Strange Way to Express Integers(中国剩余定理+不互质)
Strange Way to Express IntegersTime Limit:1000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 2891Appoint description: System Crawler (2015-04原创 2015-05-03 00:26:05 · 2360 阅读 · 0 评论 -
Chinese remainder theorem again(中国剩余定理+不互质版+hud1788)
Chinese remainder theorem againTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1788Appoint description: System Crawler (2015-04-原创 2015-05-02 18:39:33 · 1555 阅读 · 0 评论 -
Bell(hdu4767+矩阵+中国剩余定理)
BellTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4767 DescriptionWhat? MMM is learning Combinatorics!? Looks like she原创 2015-05-08 23:52:32 · 1073 阅读 · 0 评论 -
点到圆弧的距离(csu1503)
1503: 点到圆弧的距离Time Limit: 1 Sec Memory Limit: 128 MB Special JudgeSubmit: 325 Solved: 70[Submit][Status][Web Board]Description输入一个点P和一条圆弧(圆周的一部分),你的任务是计算P到圆弧的最短距离。换句话说,你需要在圆弧上找一个点,到P原创 2015-07-30 22:16:47 · 1592 阅读 · 1 评论 -
Root(hdu5777+扩展欧几里得+原根)
Root-------------------2015 Multi-University Training Contest 7Problem DescriptionGiven a number sum(1≤sum≤100000000),we have m queries which contains a pair (xi,yi) and would like to know the smallest nonnegative integer ki satisfying xkii=yi mod p whe原创 2015-08-12 00:20:17 · 1576 阅读 · 0 评论 -
Interesting Integers(CF---BAPC 14 + hnoj11589)扩展欧几里得
I Interesting Integerssource: xkcd.com/587Undoubtedly you know of the Fibonacci numbers. Starting withF1 = 1 and F2 = 1, every next number is the sum of the twoprevious ones. This results in the sequence 1, 1, 2, 3, 5, 8, 13, . . ..Now let us consider原创 2015-08-12 22:16:34 · 1427 阅读 · 0 评论 -
UVA12493 - Stars(求1-N与N互质的个数)欧拉函数
UVA12493 - Stars(求1-N与N互质的个数)欧拉函数 bnuoj26358原创 2015-08-17 12:55:16 · 2379 阅读 · 0 评论 -
CO-PRIME(初探 莫比乌斯)NYOJ1066(经典)gcd(a,b)=1
CO-PRIME时间限制:1000 ms | 内存限制:65535 KB难度:3描述This problem is so easy! Can you solve it?You are given a sequence which contains n integers a1,a2……an, your task is to find how many pa原创 2015-08-17 16:11:43 · 1549 阅读 · 0 评论 -
Visible Lattice Points(spoj7001+初探莫比乌斯)gcd(a,b,c)=1 经典
VLATTICE - Visible Lattice Pointsno tags Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0原创 2015-08-17 22:00:16 · 1163 阅读 · 0 评论 -
bzoj 2818 Gcd(莫比乌斯+gcd(a,b)=d) 经典
2818: GcdDescription给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对.原创 2015-08-19 20:28:44 · 2935 阅读 · 0 评论 -
CRB and Candies(lcm(C(n,0)..C(n,n)=lcm(1,2,,,n+1)/(n+1)))hdu5407
CRB and CandiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 358 Accepted Submission(s): 160Problem Description CRB has N d原创 2015-08-21 14:07:15 · 1646 阅读 · 0 评论 -
SPOJ4491. Primes in GCD Table(gcd(a,b)=d素数,(1<=a<=n,1<=b<=m))加强版
SPOJ4491. Primes in GCD Table Problem code: PGCD Johnny has created a table which encodes the results of some operation -- a function of two arguments. But instead of a boring mu原创 2015-08-22 12:52:50 · 1687 阅读 · 0 评论