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 1048. Superlong Sums

And what about solving this problem without any arrays?
Posted by Oleg Strekalovsky [Vologda SPU] 13 Jan 2009 19:05
I solved this problem on Java.
Memory < 1 М .Time was about 0.8 c. Without any arays!!!
Are your can? =).
Thanks to Fyodor Menshikov.
He was rigth about limitation.
Re: And what about solving this problem without any arrays?
Posted by Maxim Dvoynishnikov (Dnipropetrovsk SU) 13 Jan 2009 21:50
Using recursive procedure like topological sorting.
Re: And what about solving this problem without any arrays?
Posted by SevenEleven [Tartu U] 13 Jan 2009 23:05
Recursion implicitly uses array (stack), so used memory will be the same.

Edited by author 13.01.2009 23:26
Re: And what about solving this problem without any arrays?
Posted by Yurchuk Maxim, Rybinsk, Liceum #2 14 Jan 2009 15:37
And how?
Re: And what about solving this problem without any arrays?
Posted by Fyodor Menshikov 17 Jan 2009 02:51
Yurchuk Maxim, Rybinsk, Liceum #2 wrote 14 January 2009 15:37
And how?

Think.

Look at memory compsumption of first solutions of the problem.
Re: And what about solving this problem without any arrays?
Posted by litaoye 30 Mar 2009 00:06
if(A+B > 9)
.....
Console.Write(last+1);
if(A+B == 9)
count++;
......
if(A+B < 9)
Console.Write(last);

but it's slow,so it's not a good way