#include
#include<math.h>
#include
using namespace std;
int main() {
int long long n,q,val,k;
cin>>n;
vector dp(1000000,0);
while(n–)
{
cin>>val;
for(int long long i=1;i<=pow(val,0.5);i++)
{
if(val%i==0)
{
dp[i]++;
dp[val/i]++;
}
}
}
cin>>q;
while(q–)
{
cin>>k;
cout<<dp[k]<<endl;
}
return 0;
}
what is the problem in this code???
Find it number theory question
Hey @nishkarshbisht18
Compare your solution to this https://ide.codingblocks.com/s/180997
If your doubt is resolved please mark it as closed.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.