ENG
RUS
Timus 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
zzzlll
i thing problem not in longint no inaf
[1] // Problem
1012. K-based Numbers. Version 2
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.
Liu Yizhou
You way are currect but you MUST use HI-precision
// Problem
1012. K-based Numbers. Version 2
26 Jun 2007 12:44
You way are currect but you MUST use HI-precision
© 2000–2026
Timus Online Judge Team
. All rights reserved.