My Solution to the Problem of Round #749 D is giving TLE on a very small test , though it could be an infinite loop , I cross checked on my PC and custom test on Codeforces and it runs fine for the same test.
If anyone could tell me what this is , I would be really grateful !!
Thanks a Lot !
Hey, I encountered a similar problem, but on test 2. Just writing this comment to not lose your post and check it if someone explains the reason:)
UPD: I've also written similar post with submission link: https://codeforces.net/blog/entry/96081
Thanks for the reply , I was stuck on this for 40 mins but found nothing. I will not be able to sleep tonight lol
Similar to my comment here, it is visible from the custom test that your code violates the constraint $$$1 \leq a_i \leq n$$$.
Thank you very much !! Orz