ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1024. Permutations

WA #7
Posted by btas 25 Sep 2016 18:27
Hi
I try to solve this task by computing cycle for i in [1..n] (k : P^k(i) = i) and multiplying all k[i] (not forgetting about if k[j] > k[i] and k[j] % k[i] == 0 then k[i] = 1)
And i got the WA #7. Where is my mistake?
Sorry for my poor english.
Re: WA #7
Posted by btas 25 Sep 2016 18:54
I found my mistake. Just used LCM(k[i])