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

255 KB
Posted by Tambov SU 25 Oct 2007 01:36
My algo works with 255 Kb memory and 1ms. what can I improve in code to get ~120 KB, as in best results?

[code deleted]

Edited by moderator 04.12.2019 20:44
Re: 255 KB
Posted by OZone 5 Apr 2013 01:04
1) You don't need d.
2) If you'd like to improve speed even further, I suggest you to flag out elements in P that you have reached. In this case you'll get O(N) instead of O(N^2).