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 1296. Hyperjump

why my sollution take WA on test #3
Posted by Pavel Sergeev 17 Nov 2009 18:17
var
p:int64;
i,n,x:integer;
max:int64;
begin
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
readln(n);
readln(p);
max:=p;
for i:=1  to n-1 do
  begin
  readln(x);
  if x>=p+x then p:=x else p:=p+x;
  if p>max then max:=p;
  end;
if max<0 then  writeln(0) else writeln(max);
end.

Edited by author 18.11.2009 00:20

Edited by author 18.11.2009 00:21

Edited by author 18.11.2009 00:23
Re: why my sollution take WA on test #3
Posted by iliya785 27 Dec 2013 07:02
check: n = 0