Need help with a Euler totient problem

Revision en2, by Tritina, 2021-09-04 14:35:52

Hello, Check out problem F from this gym, https://mirror.codeforces.com/gym/100975/attachments Seems like an easy Euler-totient problem, and I think my idea is right too. I am using a^n = a^(n % phi[m] + phi[m]) mod m ; when n >= log m. But I don't get why I am getting an RE.

My code: https://mirror.codeforces.com/gym/100975/submission/127826630

Can anyone check the code for me? and please also let me know if these kinds of help-seeking entries are violating any community rule.

TIA <3

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Tritina 2021-09-04 14:35:52 32
en1 English Tritina 2021-09-04 14:34:28 523 Initial revision (published)