@keyan then also it is given time limit exceed ................
i don't know what to do..............plzz help me plzzzzzzzzzzzzz
my modified code is :
# include<stdio.h>
int main()
{
long long int phi[1000001];
long long int i,j,t1,k;
scanf("%lld",&t1);
while(t1--)
{
scanf("%lld",&k);
phi[1]=1;
for ( i=2; i<=k; ++i) phi[i]=i;
for ( i=2; i<=k; ++i)
if (phi[i]==i) // prime
for ( j=i; j<=k; j+=i)
phi[j]=phi[j]/i*(i-1);
printf("%lld\n",phi[k]);
}
return 0;
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.