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

Nope, just your algorithm is slow......... Too many interations are made..
Posted by Algorist 7 Sep 2001 02:59
Consider this :
Your program does 10^9*10^3=10^12 . Time Limit-> 1 sec.
With 10^12 you need much more........
There is a solution
Posted by Alexander Mavrov 7 Sep 2001 22:22
There is a simple method of encoding/decoding of
permutations on N elements that is O(N).It is based on the
removal of used elements.