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 1079. Maximum

Here's my AC program !
Posted by Andrei Ghiuru [Agorex] 28 Apr 2003 01:25
Here is my AC program:

var a: array[0..100000]of integer;
    v: array[1..10]of integer;
    n,i,k,j: longint;

begin
  a[0]:=0;
  a[1]:=1;
  for i:=2 to 100000 do
   begin
    if i mod 2=0 then a[i]:=a[i shr 1]
     else a[i]:=a[i shr 1]+a[i shr 1+1];
   end;
 k:=0;
 readln(n);
 while n>0 do
  begin
   inc(k);
   j:=1;
   for i:=2 to n do if a[i]>j then j:=a[i];
   v[k]:=j;
   readln(n);
  end;
 for i:=1 to k do writeln(v[i]);
end.
Re: Here's my AC program !
Posted by Searchers 3 Nov 2004 16:47
Thanx!!
Re: Here's my AC program !
Posted by cello-satol 17 Nov 2006 15:48
Thank you.Because I used your program.Thank.
Re: Here's my AC program !
Posted by Bobur 19 Dec 2007 20:43
thanks alot, because i find my mistake with your code