
数论
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
POJ2739--Sum of Consecutive Prime Numbers
DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer原创 2013-02-04 15:00:47 · 398 阅读 · 0 评论 -
Find something
DescriptionFangjie is studying evolution of worms. Recently he putforward hypotheses that all worms evolve by division. There arenforms of worms. Worms of these forms have lengthsa1,a2, ..原创 2013-03-03 19:40:31 · 518 阅读 · 0 评论 -
POJ3292--Semi-prime H-numbers
DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of4n+1 numbers. Here, we do only a bit of that.An H-number is a positive原创 2013-03-15 11:58:29 · 723 阅读 · 0 评论 -
Imps --此题主要是体会下效率
Problem DescriptionThe world is in danger. One famous swindler passed away recently (by the way, nobody knows his real name, so let's call him Ostap). Having got to the hell he decided to make a dea原创 2013-03-17 13:43:57 · 881 阅读 · 0 评论 -
POJ2886--Who Gets the Most Candies?
DescriptionN children are sitting in a circle to play a game.The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The原创 2013-03-31 18:44:19 · 777 阅读 · 0 评论 -
POJ1905--Expanding Rods
DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid walls an原创 2013-03-18 19:43:18 · 828 阅读 · 0 评论 -
POJ2635--The Embarrassed Cryptographer--大数取模
DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic原创 2013-04-01 18:22:53 · 889 阅读 · 0 评论 -
HDU4291-- A Short problem
Description According to a research, VIM users tend to have shorter fingers, compared with Emacs users. Hence they prefer problems short, too. Here is a short one: Given n (1 18), You shoul转载 2013-05-17 21:57:03 · 788 阅读 · 0 评论 -
Continued Fractions
A continued fraction of height n is a fraction of form . You are given two rational numbers, one is represented as and the other one is represented as a finite fraction of height n. Check if th原创 2013-05-20 15:03:54 · 1587 阅读 · 0 评论 -
数论进制水题
DescriptionGive you a scale, a goods weigts m kilograms. And then give you some stones weighting 1, 3, 9, 27, ..., 3^k. Of course, the number of different weights' is only ONE.Now put the good原创 2014-03-17 18:35:24 · 722 阅读 · 0 评论 -
活动中心--三分法
描述A市是一个高度规划的城市,但是科技高端发达的地方,居民们也不能忘记运动和锻炼,因此城市规划局在设计A市的时候也要考虑为居民们建造一个活动中心,方便居住在A市的居民们能随时开展运动,锻炼强健的身心。城市规划局希望活动中心的位置满足以下条件:1. 到所有居住地的总距离最小。2. 为了方便活动中心的资源补给和其他器材的维护,活动中心必须建设在A市的主干道上。为了简化问题,原创 2014-04-19 22:55:37 · 1361 阅读 · 0 评论 -
[转]扩展欧几里得
欧几里德算法欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。gcd函数就是用来求(a,b)的最大公约数的。 gcd函数的基本性质:性质一:gcd(a,b)=gcd(b,a)=gcd(-a,b)=gcd(|a|,|b|)证明略。 性质二:gcd(a,b)=gcd(b,a mod b)证明:a可以表示成a = kb + r转载 2015-01-26 22:13:40 · 486 阅读 · 0 评论 -
[转]欧拉函数公式及其证明
欧拉函数:欧拉函数是数论中很重要的一个函数,欧拉函数是指:对于一个正整数 n,小于 n且和 n互质的正整数(包括 1)的个数,记作φ(n)。完全余数集合:定义小于 n且和 n互质的数构成的集合为 Zn,称呼这个集合为 n的完全余数集合。显然 |Zn|=φ(n)。有关性质:对于素数 p,φ(p) = p-1。对于两个不同转载 2015-01-27 10:44:26 · 1248 阅读 · 0 评论 -
团战可以输 提莫必须死
Description在lol的众多英雄当中,有一只无辜的兔子,叫提莫。。。据最新数据统计,lol国服当中每天会死亡提莫650W只。。。有一种说法就叫“团战可以输,提莫必须死”。。。至于为什么嘛。。。loler们都懂的。。。那么现在残血的提莫(HP == 1)面临来自四个敌人的大招攻击,分别是:寒冰射手艾希的魔法水晶箭探险家伊泽瑞尔的精准弹幕荣耀行刑原创 2013-03-03 16:56:25 · 1103 阅读 · 0 评论 -
Sum of mod
DescriptionWe define function F like this,F(n) = ( n % 1 ) + ( n % 2 ) + ( n % 3 ) + ... + ( n %n )Now you are give a postive number n,please find theF(n).Input DescriptionThe in原创 2013-03-03 16:32:07 · 456 阅读 · 0 评论 -
Goldbach's Conjecture
DescriptionFangjie is studying evolution of worms. Recently he putforward hypotheses that all worms evolve by division. There arenforms of worms. Worms of these forms have lengthsa1,a2, ..原创 2013-03-03 16:48:26 · 586 阅读 · 0 评论 -
Shift Number
DescriptionIf a number is the sum of an integer’s several shifting forms, it is called the Shift Number.For example, by shifting 123 four times and adding the four numbers together, we get 13665原创 2013-03-03 17:08:12 · 871 阅读 · 0 评论 -
Increase and Decrease--codeForces 246B
DescriptionPolycarpus has an array, consisting of n integers a1, a2, ..., an. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as p原创 2013-02-22 20:37:34 · 732 阅读 · 0 评论 -
素数打表
#include #include using namespace std;#define maxn 5000008bool A[maxn];//一int main(){ memset(A,0,sizeof(A)); for(int i=2;i*i<=maxn;i++)//二 { if(!A[i]) { for(int j=i*i;j<=ma原创 2013-02-23 18:24:52 · 368 阅读 · 0 评论 -
GCD LCM--UVA11388
Description I I U C O N L I N E C O N T E S T 2 0 0 8Problem D: GCD LCMInput: standard inputOutput: standard output The GCD of two p原创 2013-02-23 22:40:00 · 672 阅读 · 0 评论 -
codeForces 271B--素数矩阵
DescriptionYou've got an n × m matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary element of the matrix and increase i原创 2013-02-23 22:45:17 · 1063 阅读 · 0 评论 -
HDU1936--Counting Triangles
DescriptionGiven an equilateral triangle with n the length of its side, program to count how many triangles in it. InputThe length n (n process to the end of the file原创 2013-02-24 23:37:38 · 587 阅读 · 0 评论 -
POJ2545--Hamming Problem
DescriptionFor each three prime numbers p1, p2 and p3, let's define Hamming sequence Hi(p1, p2, p3), i=1, ... as containing in increasing order all the natural numbers whose only prime divisors are原创 2013-02-25 09:55:55 · 735 阅读 · 0 评论 -
LCM Challenge--codeForces 235A
DescriptionSome days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it.But I also don't want to use many nu原创 2013-02-25 20:29:15 · 1105 阅读 · 0 评论 -
Hometask--codeForces 214B
DescriptionFurik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark for math. For that Ms. Ivanova, his math teacher, gave him a new task原创 2013-02-25 21:49:24 · 866 阅读 · 0 评论 -
Prime Gap--素数打表
DescriptionThe sequence of n − 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime numbers p and p + n is called a prime原创 2013-03-12 19:17:15 · 1084 阅读 · 0 评论 -
[转]中国剩余定理
中国剩余定理可以描述为:若某数x分别被d1、、…、dn除得的余数为r1、r2、…、rn,则可表示为下式:x=R1r1+R2r2+…+Rnrn+RD其中R1是d2、d3、…、dn的公倍数,而且被d1除,余数为1;(称为R1相对于d1的数论倒数)R1 、R2 、… 、Rn是d1、d2、…、dn-1的公倍数,而且被dn除,余数为1;D是d1、d2、…、的最小公倍数;转载 2015-01-27 13:41:03 · 1414 阅读 · 0 评论