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 1117. Hierarchy

pls pls pls pls pls help... how to store so many numbers
Posted by manishmmulani 29 Dec 2007 20:10
for the range 1 to 2^31-1 even O(n) soln won't work
i.e even a single loop will take more time

if we want to use f(n,m) = abs(f(1,n)-f(1,m))

we need to store 2^31 values... how is it possible to store so many numbers!!!!
Re: pls pls pls pls pls help... how to store so many numbers
Posted by Chmel_Tolstiy 30 Dec 2007 15:16
You don't need to store so many numbers. Tey to find another way (try to see how change length between fixed nodes). f(n,m) = abs(f(1,n) - f(1,m)) - it's ok.
Re: pls pls pls pls pls help... how to store so many numbers
Posted by manishmmulani 3 Jan 2008 18:51
ok thanx .. will try it