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

个人可以备案网站/地方网站建设

个人可以备案网站,地方网站建设,网站的建立目的,短剧分销平台min 25 比较好的教程 luogu yyb min25 与杜教筛和线性筛不同的是&#xff1a;容斥原理的应用&#xff0c;巧妙的利用容斥原理实现了计算量的减少利用数论分块的理论实现有限点的dp运算利用素数的数量小的特点实现暴力运算 #include <bits/stdc.h> #define mem(ar,num) m…

min 25
比较好的教程
luogu
yyb

  1. min25 与杜教筛和线性筛不同的是:容斥原理的应用,巧妙的利用容斥原理实现了计算量的减少
  2. 利用数论分块的理论实现有限点的dp运算
  3. 利用素数的数量小的特点实现暴力运算
#include <bits/stdc++.h>
#define mem(ar,num) memset(ar,num,sizeof(ar))
#define me(ar) memset(ar,0,sizeof(ar))
#define lowbit(x) (x&(-x))
#define Pb push_back
#define  FI first
#define  SE second
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define IOS ios::sync_with_stdio(false)
#define DEBUG cout<<endl<<"DEBUG"<<endl; 
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const int    prime = 999983;
const int    INF = 0x7FFFFFFF;
const LL     INFF =0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const double inf = 1e18;
const double eps = 1e-6;
const LL     mod = 1e9 + 7;
LL qpow(LL a,LL b){LL s=1;while(b>0){if(b&1)s=s*a%mod;a=a*a%mod;b>>=1;}return s;}
LL gcd(LL a,LL b) {return b?gcd(b,a%b):a;}
int dr[2][4] = {1,-1,0,0,0,0,-1,1};
LL n,sqr;
const int maxn = 100100;
int Prime[maxn],vis[maxn],tot,gp1[maxn],gp2[maxn];
const int inv2 = qpow(2,mod-2),inv6 = qpow(6,mod-2);
LL w[maxn*2],sw;
int g1[maxn*2],g2[maxn*2];
int id1[maxn],id2[maxn];int S(LL x, int y) {if (Prime[y] >= x) return 0;int  p = x <= sqr ? id1[x] : id2[n / x];int ret = ((0LL + g2[p] - g1[p] - (gp2[y] - gp1[y])) % mod + mod) % mod;for (int i = y + 1; i <= tot && 1LL * Prime[i]*Prime[i] <= x; ++i) {LL pe = Prime[i];for (int e = 1; pe <= x; ++e, pe *= Prime[i]) {int o = pe % mod;ret = (ret + 1LL * o * (o - 1) % mod * (S(x / pe, i) + (e != 1))) % mod;}}return ret;
}int main(void){scanf("%lld",&n);sqr = sqrt(n);vis[1] = 1;for(int i = 2;i <= sqr; ++i){if(!vis[i]) Prime[++tot] = i;for(int j = 1;j <= tot&&i*Prime[j] <= sqr; ++j){vis[i*Prime[j]] = 1;if(i%Prime[j] == 0) break;}}for(int i = 1;i <= tot; ++i)gp1[i] =(gp1[i-1]+Prime[i])%mod,gp2[i]=(gp2[i-1]+1ll*Prime[i]*Prime[i])%mod;for(LL l = 1,r;l <= n; l = r+1){r = n/(n/l);w[++sw] = n/r;g1[sw] = w[sw]%mod;g2[sw] = 1ll*g1[sw]*(g1[sw]+1)%mod*(2*g1[sw]+1)%mod*inv6%mod-1;g1[sw] = 1ll*g1[sw]*(g1[sw]+1)%mod*inv2%mod-1;if(n/r <= sqr) id1[n/r] =sw;else id2[r] = sw;}for(int i= 1;i <= tot; ++i){LL tmp = 1ll*Prime[i]*Prime[i];for(int j = 1;j <= sw&&tmp <= w[j];++j){LL p = w[j]/Prime[i];p = (p <= sqr?id1[p]:id2[n/p]);g1[j] = (g1[j]-1ll*Prime[i]*(g1[p]-gp1[i-1])%mod+mod)%mod;g2[j] = (g2[j]-1ll*Prime[i]*Prime[i]%mod*(g2[p]-gp2[i-1])%mod+mod)%mod;}}printf("%lld\n",(S(n,0)%mod+mod+1)%mod);return 0;
}
http://www.jmfq.cn/news/4998529.html

相关文章:

  • 学科建设的网站/北京快速优化排名
  • 绿派网站建设/企业网站多少钱一年
  • 建设手机网站平台/关键词查网址
  • 网站搭建网/搜百度盘
  • 青岛网站建设eoeeoe/快手刷评论推广网站
  • 简约风格的网站/常州网站推广公司
  • 商城网站入驻系统/免费游戏推广平台
  • 宁波做外贸网站/优化网站内容
  • 做彩票网站代理犯法吗/kol推广是什么意思
  • 什么是网络营销网络营销的目的有哪些内容/灯塔网站seo
  • 珠海响应式网站建设费用/国内新闻最新消息今天简短
  • 北京昌平网站建设/百度营销中心
  • iis8.5安装wordpress/百度网站快速优化
  • 福州响应式网站/十大放黄不登录不收费
  • 手机网站布局教程/排名sem优化软件
  • 中小企业网络设计论文/谷歌seo是什么
  • 网站开发与网页设计大作业/石家庄房价
  • 网站推广是做什么工作/推广一个产品有哪些方式
  • 所有网站域名都有/seo百度关键词优化软件
  • 先建网站还是先做app好/超级seo外链工具
  • 网站做文件检查/营销策划方案内容
  • 高端网站开发注意事项/高端企业网站模板
  • 大学网站建设评比考核办法/seo网络营销课程
  • 金阊苏州网站建设/seo技术外包
  • 重庆手机网站建设/搜索引擎有哪些
  • 装修网站实景图vr怎么做的/查询网 网站查询
  • 北京疫情消息最新通报/北京seo优化外包
  • 网站浏览记录怎么做/策划网络营销方案
  • 网站做排名教程/东莞哪种网站推广好
  • 龙岩网站制作公司/郑州网络营销公司哪个好