孙子定理: 当前存在三个式子,t%3=2,t%5=3,t%7=2.然后让你求出t的值的一个通解. 具体过程:选取3和5的一个公倍数t1能够使得这个公倍数t1%7==1,然后选取3和7的一个公倍数t2使得这个公倍数t2%5==1,然后再选取5和7的一个公倍数t3使得这个公倍数t3%3==1,求出来 t1==15,t2==21,t3==70,然后最终的答案就是(15*3+21*3+70*2)+105*n.这里的105指的是3 5 7 的最小公倍数,为什么这样做?既然是有余数,那么就把这个余数搞没了就…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 117973   Accepted: 37026 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 111285   Accepted: 34638 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
Unknown Treasure Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2389    Accepted Submission(s): 885 Problem Description On the way to the next secret treasure hiding place, the mathematician…
X问题 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4869    Accepted Submission(s): 1617 Problem Description 求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod…
Hello Kiki Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3126    Accepted Submission(s): 1164 Problem Description One day I was shopping in the supermarket. There was a cashier counting coins…
题目链接: http://poj.org/problem?id=1006 http://acm.hdu.edu.cn/showproblem.php?pid=1370 题目大意: (X+d)%23=a1,(X+d)%28=a2,(X+d)%33=a3,给定a1,a2,a3,d,求最小的X. 题目思路: [中国剩余定理] 23,28,33互素,可以套中国剩余定理. 也可以直接手算逆元. 33×28×a模23的逆元为8,则33×28×8=5544: 23×33×b模28的逆元为19,则23×33×1…
0.引子 每一个讲中国剩余定理的人,都会从孙子的一道例题讲起 有物不知其数,三三数之剩二,五五数之剩三,七七数之剩二.问物几何? 1.中国剩余定理 引子里的例题实际上是求一个最小的x满足 关键是,其中r1,r2,--,rk互质 这种问题都有多解,每一个解都为最小的解加上若干个lcm(r1,r2,...,rk),这个不用我证了吧(-_-||) 解决这个问题的方法是构造法, 先构造k个数 满足, 这样就保证 ,但是由于 bi 乘了除 ri 以外所有 r,所以bi模其它的 r 都为 0, 再把所有 b…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
B - Biorhythms Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1006 Description 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这天,人会在相应的方面表现出色.例如,智力周期的高峰,人会思维敏捷,精力容易高度集中.因为三个周期的周长…