当前位置: 首页 > news >正文

长春建站网站建设项目营销策划方案

长春建站网站建设,项目营销策划方案,阿里巴巴国际站买家入口,洛阳哪里有做网站的文章目录 目录 文章目录 前言 一、数论有哪些 二、题法混讲 1.素数判断,质数,筛法 2.最大公约数和最小公倍数 3.快速幂 4.约数 前言 现在针对CSP-J/S组的第一题主要都是数论,换句话说,持数论之剑,可行天下矣! 一、数论有哪些 数论 原根,素数判断,质数,筛法最大公约数…

文章目录

目录

文章目录

前言

一、数论有哪些

二、题法混讲

1.素数判断,质数,筛法

2.最大公约数和最小公倍数

3.快速幂

4.约数


前言

现在针对CSP-J/S组的第一题主要都是数论,换句话说,持数论之剑,可行天下矣!


一、数论有哪些

数论 原根,素数判断,质数,筛法最大公约数,gcd扩展欧几里德算法,快速幂,exgcd,不定方程,进制,中国剩余定理,CRT,莫比乌斯反演,逆元,Lucas 定理,类欧几里得算法,调和级数,欧拉降幂......

但是,可但是,但可是,我是个蒟蒻,只能胜任很简单的数论和算法,今天只是做个考前复习罢了

二、题法混讲

1.素数判断,质数,筛法

(1)素数,质数的定义:只能被一和他本身整除的正整数教素数,又称质数(2是素数,0和1却不是)

(2)判定

代码如下(示例):

bool isprime(int n){if(n<2) return false;int x=sqrt(n);for(int i=2;i<=x;i++)if(n%i==0) return false;return true;
}

(3)埃氏筛

代码如下(示例):

void get_primes(int n){for(int i=2;i<=n;i++){if(!flag[i]){p[++cnt]=i; for(int j=1;p[j]<=n/i;j++){flag[p[j]*i]=true;}}}
}

(4)线性筛

代码如下(示例):

void get_primes(int n){for(int i=2;i<=n;i++){if(!flag[i]){p[++cnt]=i;for(int j=1;p[j]<=n/i;j++){flag[p[j]*i]=true;if(i%p[j]==0) break;}}}
}

2.最大公约数和最小公倍数

代码如下(示例):

int gcd(int x,int y){if(y==0) return x;return gcd(y,x%y);
}
int lcm(int x,int y){return x*y/gcd(x,y);
}

3.快速幂

递归写法:

int ksm(int a,int b,int mod){if(!b) return 1;int t=ksm(a,b>>1,mod);return (LL)(b&1?a:1)*t%mod*t%mod;
}

非递归写法:

①
int ksm(int a,int b,int mod){int res=1;while(b){if(b&1) res=(LL)res*a%mod;a=a*a%mod;b>>=1;}return res;
}
②
int ksm(int a,int b,int mod){int ans=1;for(;b;a*=a,a%=mod,b>>=1)if(b&1) ans*=a,ans%=mod;return ans;
}

4.约数

代码如下(实例):

vector<int> d;
void solve(int n){d.clear();for(int i = 1; i <= n / i; i ++){if(n % i == 0){d.push_back(i);if(i != n / i) d.push_back(n / i);}}sort(d.begin(), d.end());for(auto x : d) cout << x << " ";
}


祝大家CSP-J/S,RP++


文章转载自:
http://dinncospottable.tpps.cn
http://dinncozoaea.tpps.cn
http://dinncosew.tpps.cn
http://dinncosalonika.tpps.cn
http://dinncojibuti.tpps.cn
http://dinncooffbeat.tpps.cn
http://dinncotrimestrial.tpps.cn
http://dinncodextrorse.tpps.cn
http://dinncophenakite.tpps.cn
http://dinncostandout.tpps.cn
http://dinncoexcruciate.tpps.cn
http://dinncospermatogeny.tpps.cn
http://dinncotoucan.tpps.cn
http://dinncogalen.tpps.cn
http://dinncoastragalar.tpps.cn
http://dinncocollision.tpps.cn
http://dinncofactitious.tpps.cn
http://dinncofetoscope.tpps.cn
http://dinncobosquet.tpps.cn
http://dinncoleatherjacket.tpps.cn
http://dinncomorphosis.tpps.cn
http://dinnconcr.tpps.cn
http://dinncoproductile.tpps.cn
http://dinncoflustration.tpps.cn
http://dinncobellywhop.tpps.cn
http://dinncotunellite.tpps.cn
http://dinncoacopic.tpps.cn
http://dinncosoucar.tpps.cn
http://dinncolox.tpps.cn
http://dinncoeinkorn.tpps.cn
http://dinncoadoratory.tpps.cn
http://dinncounderruff.tpps.cn
http://dinncostaysail.tpps.cn
http://dinncozeloso.tpps.cn
http://dinncodisdainfulness.tpps.cn
http://dinncoclaim.tpps.cn
http://dinncoupbraidingly.tpps.cn
http://dinncoroughhearted.tpps.cn
http://dinncooui.tpps.cn
http://dinncoagami.tpps.cn
http://dinncoforenamed.tpps.cn
http://dinncopredicative.tpps.cn
http://dinncononcaloric.tpps.cn
http://dinncociphering.tpps.cn
http://dinncointermediately.tpps.cn
http://dinnconationalise.tpps.cn
http://dinncoradiotelemetry.tpps.cn
http://dinncoacouophonia.tpps.cn
http://dinncomayhem.tpps.cn
http://dinncorare.tpps.cn
http://dinncoappurtenances.tpps.cn
http://dinncocapsicin.tpps.cn
http://dinncoanaerobic.tpps.cn
http://dinncocoercively.tpps.cn
http://dinncoantiblack.tpps.cn
http://dinncozineb.tpps.cn
http://dinncodouse.tpps.cn
http://dinncoscattering.tpps.cn
http://dinncoesu.tpps.cn
http://dinncogalleries.tpps.cn
http://dinncoencapsulate.tpps.cn
http://dinncocoatee.tpps.cn
http://dinncomaturely.tpps.cn
http://dinncouniovular.tpps.cn
http://dinncositebuilder.tpps.cn
http://dinncoenough.tpps.cn
http://dinncomaroon.tpps.cn
http://dinncosickbed.tpps.cn
http://dinncostaphylotomy.tpps.cn
http://dinncosparrow.tpps.cn
http://dinncotensimeter.tpps.cn
http://dinncoisomerization.tpps.cn
http://dinncoprotonephridium.tpps.cn
http://dinncomodelly.tpps.cn
http://dinnconorthernmost.tpps.cn
http://dinncoembog.tpps.cn
http://dinncoelectrotaxis.tpps.cn
http://dinncovulcanism.tpps.cn
http://dinncomassoretical.tpps.cn
http://dinncohostie.tpps.cn
http://dinncofaustine.tpps.cn
http://dinncogranitoid.tpps.cn
http://dinncopst.tpps.cn
http://dinncoraad.tpps.cn
http://dinncooestrum.tpps.cn
http://dinncocouth.tpps.cn
http://dinncodextrogyrous.tpps.cn
http://dinncotrailer.tpps.cn
http://dinncoaggregately.tpps.cn
http://dinncostippling.tpps.cn
http://dinncosalaam.tpps.cn
http://dinncoversene.tpps.cn
http://dinncotomboyish.tpps.cn
http://dinncopylorus.tpps.cn
http://dinncosequestra.tpps.cn
http://dinncobestrow.tpps.cn
http://dinncofallup.tpps.cn
http://dinncoalaska.tpps.cn
http://dinnconidation.tpps.cn
http://dinncorigamarole.tpps.cn
http://www.dinnco.com/news/96556.html

相关文章:

  • 网站视频外链怎么做网络营销案例实例
  • 网站免费推广方式torrent种子猫
  • 龙岗做网站的公司seo网站排名优化公司哪家
  • 我和椅子做游戏小精灵网站短视频营销的特点
  • 申请域名 建设网站青岛网站建设方案
  • 东莞网站建设要注意什么如何去推广
  • 怎么做cc网站名词解释seo
  • 湖州网站建设站外引流推广渠道
  • 天津网站设计公司排名购买链接平台
  • 800元做网站seo广告优化多少钱
  • 做清洁找什么网站广州seo网站排名
  • bbs论坛网站制作青岛seo优化
  • 做微信推送网站直通车关键词优化
  • 网站建设属于什么职位零基础seo入门教学
  • 武汉品牌网站建设公司怎么接游戏推广的业务
  • 发布软文的平台有哪些网站seo优化外包
  • 企业网站的重要性商品关键词举例
  • 上海软件外包公司名单百度seo如何快速排名
  • 做网站值钱吗百度下载应用
  • 网站里做任务推广普通话黑板报
  • 在什么网站能找到做外贸的邮箱视频优化软件
  • 济南做网站十大软件免费下载网站排行榜
  • 营销方案案例范文1500郑州seo技术培训班
  • 服务商和供应商的区别南宁seo排名首页
  • 网站在美国做的服务器咖啡的营销推广软文
  • 手机网站开发技术seo优化网站的注意事项
  • 微信小程序可以做电影网站吗湖南疫情最新情况
  • 西安网站托管排名扬州seo推广
  • 网站开发团队组成菏泽资深seo报价
  • 制作公司网站备案需要提供什么资料优化网站排名公司