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

Andrei Ghiuru [Agorex] Here's my AC program ! [3] // Problem 1079. Maximum 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.
Searchers Re: Here's my AC program ! [1] // Problem 1079. Maximum 3 Nov 2004 16:47
Thanx!!
cello-satol Re: Here's my AC program ! // Problem 1079. Maximum 17 Nov 2006 15:48
Thank you.Because I used your program.Thank.
Bobur Re: Here's my AC program ! // Problem 1079. Maximum 19 Dec 2007 20:43
thanks alot, because i find my mistake with your code