I am getting repeated TLE in this question.
Can you help me solve this problem ?
IDE : https://ide.codingblocks.com/s/199571
Alice and Totient
@aman_ishan
Since N is 10^6 and T is 5*10^4
Your approach of finding totient for each T is 5*10^10 complexity while max can be 10^8
So think of another approach
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.