I was doing the problem D-Power Permutation on CodeChef. The problem statement is given below:
I coded a PIE solution, but I kept getting TLE on the CodeChef server. I tried running on 10 testcases of max N and max D and randomised bijection on my own computer, but I got the result in 0.016 sec. Can someone help me out and tell me what is wrong?
Thanks in advance!
My code is given below: