AtCoder Beginner Contest 132 F - Small Products
数 sqrt 缩小范围 整除分块 1 #include <cstdio> 2 #include <cstdlib> 3 #include <cmath> 4 #include <cstring> 5 #include <string> 6 #include <algorithm> 7 #include <iostream> 8 using namespace std; 9 #define ll long long 10 11 const int maxn=1e5+10; 12 const ll mod=1e9+7; 13 const double eps=1e-8; 14 15 ll f[110][maxn],add[maxn],cnt[maxn]; 16 17 /** 18 大于sqrt(maxvalue)的x, 19 肯定是其它数到x,到从x到其它数 20 21 计数 用 整除分块 22 **/ 23 24 int main() 25 { 26 ll n,siz,mid,mmid,l,r,i,j,g=0,sum=0; 27 scanf("%lld%lld",&siz,&n); 28 mmid=sqrt(siz+eps); 29 mid=siz/(mmid+1); 30 g=0; 31 for (l=1;l<=siz;l=r+1) 32 { 33 ///[l,r] 34 r