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

Can't resolve problem on ruby, Time Exceed Issue
Posted by Sergey Khvan 6 Nov 2015 18:39
Hello, I've implemented two solutions: DP and Brut Force on ruby,
but still no luck to pass tests (#3, #4).
Does someone have good solution on ruby for that problem?
Is it my bad hands, or tests were changed and ruby cant process it fast.

If you have accepted solution, please try to submit it again.
Also, if you resolved it on ruby, please give some specific hints about solution.
Thanks!
Re: Can't resolve problem on ruby, Time Exceed Issue
Posted by Booster 18 Nov 2015 22:13
I don't know much about Ruby but I've solved this problem on Python which I suppose has  similar performance. It's very important to optimize algorithm very well in order to pass all tests on those script languages. Time your code and try not to exceed 1 sec. limit with 20 stones. Sorry, no hints about algorithm from me.