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 1012. K-based Numbers. Version 2

i thing problem not in longint no inaf
Posted by zzzlll 3 Jan 2007 22:26
you can look

var
a1,a0,p:extended;
n,k,i:extended;
begin
readln(n,k);
a1:=k-1;
i:=1;
{for i:=2 to n do
begin }
repeat
i:=i+1;
p:=a1;
a1:=(a1+a0)*(k-1);
a0:=p;
until i>=n;
{end; }
writeln(a1+a0:0:0);
end.
You way are currect but you MUST use HI-precision
Posted by Liu Yizhou 26 Jun 2007 12:44
You way are currect but you MUST use HI-precision