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 1013. K-based Numbers. Version 3

why WA in 6
Posted by zzzlll 3 Jan 2007 22:40
there is my program


var
c:array[0..1800] of real;
n,m,i ,fn:longint;
begin
readln(n,m);
c[0]:=1;
c[1]:=m-1;
i:=1;
repeat
i:=i+1;
{for i:=2 to n do   }
c[i]:=(m-1)*(c[i-1]+c[i-2]);
until i>=n;
writeln(c[n]:0:0);
end.
Re: why WA in 6
Posted by Roma Labish[Lviv NU] 4 Jan 2007 00:15
Use long arithmetics!
long arithmetics
Posted by Shady TKTL 9 Mar 2007 11:57
Roma Labish[Lviv NU] wrote 4 January 2007 00:15
Use long arithmetics!

с этим не катит! всё равно WA #7
Re: long arithmetics
Posted by Romko [Lviv NU] 9 Mar 2007 13:47
Send me your solution to my e-mail w_soulreaver[at]ukr[dot]net .And I'll try to help you! :)
my solution
Posted by Shady TKTL 9 Mar 2007 15:40
I send to you my solution