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 1001. Reverse Root

Memory usuage is too much
Posted by Zhihua Lai 22 Jan 2007 21:41
Hi,
Can anybody tell me how to solve this problem with less memory because I managed to solve it but with more than 5000KB.
Re: Memory usuage is too much
Posted by KIRILL(ArcSTU) 23 Jan 2007 00:19
Why do you use so much memory:)
You just need array for 256K/2 64 bit numbers
So 256*1024*8/2 = 1 MB

Another variant is parsing text from then end (256Kb)
Re: Memory usuage is too much
Posted by Zhihua Lai 26 Jan 2007 20:04
Ha, I see, i juse link-data structure.
we just need to store the input text, don't we?
Re: Memory usuage is too much
Posted by KIRILL(ArcSTU) 26 Jan 2007 21:10
Zhihua Lai wrote 26 January 2007 20:04
Ha, I see, i juse link-data structure.
we just need to store the input text, don't we?
Link-data structure :) is it joke

just read all numbers to static array and out this from the end

or

read whole text and extract numbers starting from
the end