snacks模拟赛t2
来源:互联网 发布:地坪找平层算法 编辑:程序博客网 时间:2024/06/05 20:28
/*
这题正解竟然分块,坑啊....
此代码不正确...
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
const int mod=998244353;
const int maxn=30000000;
ll l,r,ans=0,prime[]={0,2,3,5,7,11,13,17,19,23,29};
int main(){
cin>>l>>r;
int now,flag;
ll res=0;
for(int i=1;i<=sqrt(r);i++){
flag=false;
for(int j=1;j<=10;j++){
if(prime[j]>=i) break;
if(i%prime[j]==0){
flag=true;
break;
}
}
if(flag) continue;
now=i;
for(int j=1;j<=20;j++){
if(now>r) break;
ans=ans+((r/now)-(l/now))%mod;
if(l%now==0) ++ans;
if(now>sqrt(r)) ++res;
ans%=mod;
now=now*i;
if(j==1&&i!=2&&i!=3&&i!=5&&i!=7&&i!=11&&i!=13&&i!=17&&i!=19&&i!=23&&i!=29)
break;
if(i==1) break;
}
ans%=mod;
}
ans=(ans+(r-(ll)(sqrt(r)))%mod)%mod;
ans=(ans-res+mod)%mod;
cout<<ans<<endl;
return 0;
}
*/
/*
//暴力五十五分,也是需要想一想的,所以发上来了
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
const int mod=998244353;
ll l,r,ans=0;
int main(){
cin>>l>>r;
for(int i=1;i<=r;i++){
ans=ans+((r/i)-(l/i))%mod;
ans%=mod;
if(l%i==0) ans=ans+1;
ans%=mod;
}
ans%=mod;
cout<<ans<<endl;
return 0;
}
*/
- snacks模拟赛t2
- snacks的模拟赛(t1)
- 20160823模拟赛T2
- 20160907模拟赛T2
- 【20160904】NOIP模拟赛T2
- snacks
- 【faebdc的模拟赛】T2分组
- mNOIP 模拟赛 day1 T2 数颜色
- 11.15日模拟 T2
- NOIP模拟10.5 T2
- June 11th 模拟赛C T2 Cowski Solution
- June 11th 模拟赛B T2 翻山越岭 Solution
- July 14th 模拟赛C T2 数码问题 Solution
- July 15th 模拟赛C T2 积木游戏 Solution
- July 17th 模拟赛C T2 Number Solution
- September 3rd 模拟赛C T2 比赛 Solution
- September 10th 模拟赛C T2 火炬手 Solution
- September 17th 模拟赛C T2 独立集 Solution
- 二级列表
- JQuery
- swift
- 洛谷P3166 [CQOI2014]数三角形
- 爬虫一些问题
- snacks模拟赛t2
- 周末记录--2017.10.22
- codeforce 347c
- 基于“视频图像”的人脸识别算法
- ACM 大数运算 A/B Problem
- 纯js代码的计时器
- 框架面试题
- 多线程基本概念
- 二分查找总结