【数论-------------------------】
文章平均质量分 80
Here_jiaxinwei
这个作者很懒,什么都没留下…
展开
-
2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛E Half-consecutive Numbers
time limit2000msmemory limit131072KBThe numbers 1 , 3 , 6 , 10 , 15 , 21 , 28 , 36 , 45 and t(i) = [i(i + 1) ] / 2, are called half-consecutive.For given N , find the smalle原创 2017-09-09 20:50:49 · 307 阅读 · 0 评论 -
【拉格朗日插值法求自然数幂和】
求自然数幂和: 111.什么是拉格朗日插值法拉格朗日插值法,就是对于给定的几个点找到关于这几个点的函数;以下是拉格朗日插值法的具体使用:对某个多项式函数,已知有给定的k + 1个取值点:{\displaystyle (x_{0},y_{0}),\ldots ,(x_{k},y_{k})}其中{\displaystyle x_{j}}对应着原创 2017-07-17 22:21:07 · 3960 阅读 · 1 评论 -
【数论】hdu 6069 Counting Divisors
Counting DivisorsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 2815 Accepted Submission(s): 1040Problem DescriptionIn mathematic原创 2017-08-07 10:11:11 · 255 阅读 · 0 评论 -
【数论-莫比乌斯】小练
2005: [Noi2010]能量采集题意:有一二维平面n*m,从(0,0)开始看,到每个点的贡献为(gcd(i,j)-1)*2+1,求总贡献;思路:枚举gcd,二维平面优化复杂度O(sqrt(n)+sqrt(m));if(n>m) swap(n,m) 代码:#include#include#includeusing namespace std;#define m原创 2017-08-05 15:48:36 · 238 阅读 · 0 评论 -
【数论-莫比乌斯】hdu 6053 TrickGCD
TrickGCDTime Limit: 5000/2500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2846 Accepted Submission(s): 1071Problem DescriptionYou are given an arra原创 2017-08-05 10:38:34 · 103 阅读 · 0 评论 -
【数论-莫比乌斯入门】hdu 1695 GCD
莫比乌斯反演: 莫比乌斯反演变形: 假设:n :gcd(i,j)=d的倍数的数对的个数原创 2017-08-04 09:55:52 · 406 阅读 · 0 评论 -
【数论-莫比乌斯】SPOJ-7001-Visible Lattice Points 、zoj 3435 Ideal Puzzle Bobble
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,0)原创 2017-08-04 16:29:05 · 307 阅读 · 0 评论 -
【数论-莫比乌斯】bzoj 2301 莫比乌斯+容斥
2301: [HAOI2011]Problem bTime Limit: 50 Sec Memory Limit: 256 MBSubmit: 5414 Solved: 2488[Submit][Status][Discuss]Description对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数原创 2017-08-04 13:20:01 · 220 阅读 · 0 评论 -
【数论-莫比乌斯】hdu 2841 Visible Trees
Visible TreesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3326 Accepted Submission(s): 1449Problem DescriptionThere are many trees原创 2017-08-04 12:23:44 · 314 阅读 · 0 评论 -
【逆元】
逆元(inv)1.什么是逆元当求解公式:(a/b)%m 时,因为b可能会过大,会出现爆精度的情况,所以可以变除法为乘法:设c时b的逆元,有b*c≡1(mod m);则(a/b)%m = (a/b)*1%m = (a/b)*b*c%m = a*c(mod m);即a/b的模等于a*b的逆元的模;所以逆元就时这样应用的了;2.求逆元的方法(1).费马小定理在原创 2017-07-17 22:49:07 · 19289 阅读 · 4 评论 -
【模板】组合数求余--lucas定理
存一波模板://组合数求余,lucas定理ll fac[N]; //阶乘ll C(ll n,ll k,ll mod){ if(n<k||n<0||k<0) return 0; return fac[n]*pow_mod(fac[n-k]*fac[k]%mod,mod-2,mod)%mod;}ll lucas(ll a,ll b,ll mod){转载 2017-08-16 11:05:59 · 247 阅读 · 0 评论 -
【组合数】hrbustoj 1744 Pascal's Triangle
Pascal's TriangleTime Limit: 1000 MSMemory Limit: 65535 KTotal Submit: 115(23 users)Total Accepted: 27(16 users)Rating: Special Judge: NoDescription原创 2017-07-24 12:01:14 · 317 阅读 · 0 评论 -
【组合数+全错排】fzuoj 2282 Wand
Problem 2282 WandAccept: 31 Submit: 95Time Limit: 1000 mSec Memory Limit : 262144 KB Problem DescriptionN wizards are attending a meeting. Everyone has his own magic wand. N magi原创 2017-07-24 09:52:10 · 332 阅读 · 0 评论 -
【数论-异或】nyoj-备用 2345: A problem that's so easy
2345: A problem that's so easy时间限制: 1 Sec 内存限制: 128 MB提交: 96 解决: 24[提交][状态][讨论版]题目描述其他的故事就不多说了,但这一季,故事简单到出乎你的想象。给你n个数的数组,找出异或值为正整数的所有子区间中长度最长的那个。输入第一行只有一个整数n。第二行n个整数Ai。原创 2017-07-30 10:37:19 · 264 阅读 · 0 评论 -
【数论】玲珑oj 1145 - A simple math problem
1145 - A simple math problemTime Limit:2s Memory Limit:128MByteSubmissions:1620Solved:277DESCRIPTIONYou have a sequence anan, which satisfies:Now you should find原创 2017-07-30 18:19:45 · 389 阅读 · 0 评论 -
玲珑oj1144
1144 - 数论你还会快速幂Time Limit:5s Memory Limit:256MByteSubmissions:462Solved:96DESCRIPTION今天HHHH在学数论,他看到一个很优美的式子:∑ni=1ik mod p∑i=1nik mod p一向热衷于抱队友大腿的HHHH便问队友ZZZZ怎么做原创 2017-07-17 21:44:55 · 475 阅读 · 0 评论 -
51nod 1135原根
1135 原根基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注设m是正整数,a是整数,若a模m的阶等于φ(m),则称a为模m的一个原根。(其中φ(m)表示m的欧拉函数)给出1个质数P,找出P最小的原根。Input输入1个质数P(3 Output输出P最原创 2017-07-17 09:02:53 · 163 阅读 · 0 评论 -
【拉格朗日求自然数幂和】cf622F
F. The Sum of the k-th Powerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are well-known formulas原创 2017-07-18 09:43:43 · 1107 阅读 · 0 评论