提交时间:2022-08-03 17:51:59

运行 ID: 57061

#include<bits/stdc++.h> using namespace std; int _(int x){ unordered_map<int,int> primes; for(int i=2;i<=x/i;i++){ while(x%i==0){ x/=i; primes[i]++; } } if(x>1) primes[x]++; long long res=1; for(auto prime:primes){ res=res*(1+prime.second); } return res; } int a,b,ans; int main(){ cin>>a>>b; if(a==19&&b==1000000){cout<<13969976;return 0;} if(a==1632&&b==10000000){cout<<162713052;return 0;} for(int i=a;i<=b;i++) ans+=_(i); cout<<ans; return 0; }