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 1005. Stone Pile

How to reach high efficiency
Posted by kumiya 2 Nov 2020 17:53
My Python program solved this problem using 0.7+ seconds and 64000+KB memory. However, I saw some people solved it with Python using just about 0.1 secs and 500KB mem. Can anyone give me a hint about how to reach that efficiency?
Re: How to reach high efficiency
Posted by Levon Oganesyan 2 Nov 2020 23:52
Try to use bitmasks instead of using recursion;)
Re: How to reach high efficiency
Posted by kumiya 3 Nov 2020 20:09
thx!!
Re: How to reach high efficiency
Posted by Ivan 7 Jan 2022 22:29
You can solve this task with (n/2) * 2^(n/2) complexity using meet in the middle