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 1017. Staircases

How to solve it with Only One Array[1...500]. I got MLE now!
Posted by Standlove 12 Jan 2003 18:34
I use a DP method, but because of the Memory Limit,
I can't get AC, my program need 500*500*sizeof(double) to calculate
the result.

Can someone tell me how to reduce the Memory Usage? thx a lot.
Re: How to solve it with Only One Array[1...500]. I got MLE now!
Posted by xdex 21 Mar 2003 16:00
> I use a DP method, but because of the Memory Limit,
> I can't get AC, my program need 500*500*sizeof(double) to calculate
> the result.
>
> Can someone tell me how to reduce the Memory Usage? thx a lot.

precalculate all values on arg from 5 to 500. write it in text file;
then bind contant : const r : array [5..500] of comp with
precalculated values.