![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
fengzhizi76506
这个作者很懒,什么都没留下…
展开
-
hduoj1018
Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35518 Accepted Submission(s): 16950Problem DescriptionIn many applicati原创 2016-10-22 16:50:11 · 229 阅读 · 0 评论 -
hduoj1215
七夕节Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44674 Accepted Submission(s): 14241Problem Description七夕节那天,月老来到数字王国,他在城门上贴了一张原创 2017-02-01 15:19:38 · 273 阅读 · 0 评论 -
hduoj1216
Assistance RequiredTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2539 Accepted Submission(s): 1332Problem DescriptionAfter the原创 2017-02-01 16:38:03 · 303 阅读 · 0 评论 -
欧拉函数的求法
定义:欧拉函数f(n),表示小于或等于n的数中与n互质的数的个数通式:f(n)=n(1-1/p1)(1-1/p2)...(1-1/pn)其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(唯一和1互质的数(小于等于1)就是1本身)。注意:每种质因数只一个。 比如12=2*2*3那么φ(12)=12*(1-1/2)*(1-1/3)=4求值方法原创 2017-02-02 18:46:18 · 851 阅读 · 0 评论 -
mobius函数的计算
计算n的mobius函数u(n)定义:将n分解成素数幂的乘积:n=p1^i1*p2^i2*...*pr^iru(n) = { 1 (n==1) 0 (乘积式中至少有一个ir>1) (-1)^r (i1==i2==...==ir==1)算法实现const int n = 1 int mu[n];int getMu(int n)原创 2017-02-02 19:03:52 · 2307 阅读 · 0 评论 -
simpson积分公式
看了Simpson积分公式,惊讶于积分方法在几何问题中竟如此强大!比如几何中的求面积、体积问题,可以用积分的方法,在某个方向上用扫描线或扫描面切过图形,求被覆盖的长度或面积,然后进行积分。对于这类问题,如果能直接求出面积、体积,或者能列出覆盖长度(面积)关于扫描线(面)的位置的函数,然后手算积分,那当然是再好不过了。但是,如果直接用解析法、公式法比较费时费力,思考难转载 2017-02-03 18:43:37 · 30177 阅读 · 3 评论 -
快速幂算法
给定a,i,n,求a^i mod n每次将指数折半来计算。long long pow_mod(long long a,long long i,long long n){ if(i == 0) return 1%n; int temp = pow_mod(a,i >> 1,n); temp = temp*temp%n; if(i&1) te原创 2017-02-03 18:55:25 · 228 阅读 · 0 评论 -
进制转换
把一个x进制的数转换成y进制说明:把x进制的数转换成十进制,然后再不断取模再倒序,转换成y进制。2string transform(int x,int y,string s){ string res = ""; int sum = 0; for (int i = 0;i { if(s[i] >= '0' && s[i] else sum =原创 2017-02-03 19:19:54 · 222 阅读 · 0 评论 -
求n位的格雷码
给定一个二进制的位数n,求出一个0到2^n-1的排列,使得相邻两项(包含头尾两项)的二进制表达中只有一位恰好不同。说明:格雷码的第i位是i xor (i >> 1),简单的O(2^n)vector Grey_Create(int n){ vector res; res.clear(); for(int i = 0;i > 1)); return res;}原创 2017-02-03 19:32:21 · 1269 阅读 · 0 评论 -
hduoj 1214
圆桌会议Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4900 Accepted Submission(s): 3435Problem DescriptionHDU ACM集训队的队员在暑假集训时经常要讨论自原创 2017-02-01 15:08:35 · 252 阅读 · 0 评论 -
hduoj 1124
FactorialTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3730 Accepted Submission(s): 2444Problem DescriptionThe most important p原创 2016-12-18 21:56:37 · 409 阅读 · 0 评论 -
hduoj 1121 序列找规律差分法
Complete the SequenceTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 592 Accepted Submission(s): 388Problem DescriptionYou probab原创 2016-12-18 19:23:23 · 677 阅读 · 0 评论 -
hduoj1115
Lifting the StoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7634 Accepted Submission(s): 3234Problem DescriptionThere are ma转载 2016-10-23 12:32:55 · 240 阅读 · 0 评论 -
hduoj1141
Factstone BenchmarkTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2101 Accepted Submission(s): 1179Problem DescriptionAmtel has原创 2016-10-23 13:08:47 · 263 阅读 · 0 评论 -
hduoj1212
Big NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7666 Accepted Submission(s): 5276Problem DescriptionAs we know, Big Num原创 2016-10-23 19:12:53 · 221 阅读 · 0 评论 -
hduoj1220
CubeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1900 Accepted Submission(s): 1523Problem DescriptionCowl is good at solving m原创 2016-10-23 19:20:03 · 230 阅读 · 0 评论 -
hduoj1492
The number of divisors(约数) about Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3501 Accepted Submission(s): 1730Pro原创 2016-10-23 19:40:56 · 194 阅读 · 0 评论 -
hduoj1593
find a way to escapeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1958 Accepted Submission(s): 759Problem Description一日,话说0068与原创 2016-10-23 20:26:01 · 319 阅读 · 0 评论 -
hduoj1722
CakeTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3750 Accepted Submission(s): 1962Problem Description一次生日Party可能有p人或者q人参加,现准备有原创 2016-10-23 22:02:26 · 233 阅读 · 0 评论 -
hduoj2036
改革春风吹满地Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30642 Accepted Submission(s): 15781Problem Description“ 改革春风吹满地,不会AC没关系;原创 2016-10-23 23:29:48 · 275 阅读 · 0 评论 -
分数的加减乘除运算
num,den是分子,分母struct Fraction{ long long num; long long den; Fraction(long long num = 0,long long den = 1) { if (den { num = -num; den = -den; } assert(den != 0)//满足条件时报错原创 2017-02-03 19:47:38 · 1748 阅读 · 0 评论