提交时间:2022-08-03 17:41:20
运行 ID: 57031
#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; for(int i=a;i<=b;i++) ans+=_(i); cout<<ans; return 0; }