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 1910. Titan Ruins: Hidden Entrance

What`s wrong??
Posted by artur_yarabei 1 Mar 2014 21:52
First test

Var
 n,i,s,a,g:integer;
 b:array [1..1000000] of integer;
Begin
 ReadLn(n);
 s:=0;
 for i:=1 to n do
  ReadLn(b[i]);
 for i:=1 to n do
 begin
  a:=b[i]+b[i+1]+b[i+2];
  if a>s then
  begin
   s:=a;
   g:=i+1;
  end;
 end;
 WriteLn(s,' ', g);
End.