
数论
文章平均质量分 63
__Simon_
此博客已转移到https://www.cnblogs.com/--Simon/
展开
-
欧拉线性筛素数
欧拉线性筛素数原理:代码:详解:代码执行过程:欧拉线性筛素数原理:简单说明一下,其筛选的原理就是,当一个数是素数时,这个数的2,3,4,,,,n倍肯定都不是素数。代码:bool isnotprime[INF]={1,1}; //isnotprime[i] 判断i是否为素数 0代表是素数 1代表不是素数int prime[INF...原创 2018-05-26 19:25:15 · 1062 阅读 · 1 评论 -
积性函数前缀和-个人总结
积性函数前缀和-个人总结【写在前面】用了一个多星期将这部分大致弄懂了,东西太多,有很多技巧,自己重新写了一下,记录自己的理解。内容与原文基本一致,在其基础上加上了一些我感觉比较重要的但他没有详细说明的东西。以下都是我逐字打出来的。如果有什么错误,请指出。前置技能里面的东西需要充分理解和记忆,在后面推导过程中会多次用到前置技能里面的东西。转载出处:author: skywalkerto...转载 2019-03-21 22:09:16 · 712 阅读 · 0 评论 -
HDU-2588-GCD-数论-欧拉函数+思维
HDU-2588-GCD-数论-欧拉函数+思维【Description】The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18...原创 2018-09-29 20:18:57 · 290 阅读 · 0 评论 -
POJ-3243-Clever Y-扩展Bsgs算法-已知a,c,p,和a^b=c(mod p),求b
POJ-3243-Clever Y-扩展Bsgs算法-已知a,c,p,和a^b=c(mod p),求b 【Description】Little Y finds there is a very interesting formula in mathematics:XYmod Z=KX^Y mod\:Z=KXYmodZ=KGiven X, Y, Z, we...原创 2018-09-28 18:48:05 · 278 阅读 · 0 评论 -
POJ-1061-青蛙的约会-数论-扩展欧几里得
POJ-1061-青蛙的约会-数论-扩展欧几里得【Description】两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这...原创 2018-09-21 21:44:55 · 239 阅读 · 0 评论 -
ZOJ-3593-One Person Game-数论-扩展欧几里得
ZOJ-3593-One Person Game-数论-扩展欧几里得【Description】There is an interesting and simple one person game. Suppose there is a number axis under your feet. You are at point A at first and your aim is point...原创 2018-09-21 20:15:25 · 322 阅读 · 0 评论 -
UVA-11754-Code Feat-数论-中国剩余定理+枚举
UVA-11754-Code Feat-数论-中国剩余定理+枚举【Description】Hooray! Agent Bauer has shot the terrorists, blown up the bad guy base, saved the hostages, exposedthe moles in the government, prevented an environment...原创 2018-09-23 20:30:45 · 305 阅读 · 0 评论 -
HDU-4135-Co-prime-数论+容斥-[a,b]内与n互素的数的个数
HDU-4135-Co-prime-数论+容斥-[a,b]内与n互素的数的个数【Description】 Given a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two integers ar...原创 2018-09-10 18:46:34 · 333 阅读 · 0 评论 -
LightOJ-1197-Help Hanzo-数论-二次筛
LightOJ-1197-Help Hanzo-数论-二次筛【Description】 Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hatto...原创 2018-09-12 19:10:35 · 229 阅读 · 0 评论 -
LightOJ-1282-Leading and Trailing-快速幂-深入理解整数
LightOJ-1282-Leading and Trailing-快速幂-深入理解整数【Description】 You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of n^...原创 2018-09-06 15:23:03 · 433 阅读 · 0 评论 -
LightOJ-1336-Sigma Function-数论-思维
LightOJ-1336-Sigma Function-数论-思维【Description】 Sigma function is an interesting function in Number Theory. It is denoted by the Greek letter Sigma (σ). This function actually denotes the sum ...原创 2018-09-06 14:12:04 · 237 阅读 · 0 评论 -
UVA-11426-GCD - Extreme (II)-数论-欧拉函数
UVA-11426-GCD - Extreme (II)-数论-欧拉函数【Description】 Given the value of N, you will have to find the value of G. The definition of G isgiven below: >G=∑i=1n−1∑j=i+1NGCD(i,j)>>G=∑i=1n...原创 2018-09-03 22:16:25 · 284 阅读 · 0 评论 -
LightOJ-1341-Aladdin and the Flying Carpet-数论-唯一分解定理
LightOJ-1341-Aladdin and the Flying Carpet-数论-唯一分解定理【Description】 It's said that Aladdin had to solve seven mysteries before getting the Magical Lampwhich summons a powerful Genie. Here we ar...原创 2018-09-05 22:08:14 · 301 阅读 · 0 评论 -
HDU-3501-Calculation 2-数论-小于n且与n互质的数的和
HDU-3501-Calculation 2-数论-小于n且与n互质的数的和【Description】 Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to...原创 2018-09-08 19:47:00 · 486 阅读 · 0 评论 -
LightOJ-1220-Mysterious Bacteria-数论-唯一分解定理
LightOJ-1220-Mysterious Bacteria-数论-唯一分解定理【Description】 Dr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x ...原创 2018-09-11 20:29:39 · 385 阅读 · 0 评论 -
2018-ACM-ICPC-沈阳赛区网络赛-G. Spare Tire-容斥-[1,n]与m互质的数的平方和
2018-ACM-ICPC-沈阳赛区网络赛-G. Spare Tire-容斥-[1,n]与m互质的数的平方和【Description】 A sequence of integer {an}\lbrace a_n \rbrace{an} can be expressed as: >an={>0,>2,>3∗an−1−an−22+n+1,n=0n=1n...原创 2018-09-11 13:02:28 · 278 阅读 · 0 评论 -
Codeforces Round #538 (Div. 2)-C. Trailing Loves (or L'oeufs?)-b进制下n!的尾零的个数
Codeforces Round #538 (Div. 2)-C. Trailing Loves (or L’oeufs?)-b进制下n!的尾零的个数【Description】Aki is fond of numbers, especially those with trailing zeros. For example, the number 9200 has two trailing z...原创 2019-03-30 22:10:10 · 226 阅读 · 0 评论