Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- #define maxSz 10e7
- vector<int>divisors(maxSz);
- void Divisor(int n)
- {
- for(int i=1;i<=n;i++)for(int j=i;j<=n;j+=i)divisors[j]++;
- return;
- }
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- #ifndef ONLINE_JUDGE
- freopen("input.cpp","r",stdin);
- //freopen("output.cpp","w",stdout);
- #endif // ONLINE_JUDGE
- ll a,b,n,cnt=0;
- cin>>a>>b>>n;
- if(a>b)swap(a,b);
- Divisor(b);
- for(int i=a;i<=b;i++)if(divisors[i]==n)cnt++;
- cout<<cnt<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement