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 WA? I can't understand!
Posted by Dr.Dro 14 Jun 2007 20:53
Here is my code:

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n,max,i,sum,a:integer;

begin
 max:=0;
 sum:=0;
 readln(n);
 for i:=1 to n do
  begin
   readln(a);
   sum:=sum+a;
   if sum>max then
    max:=sum;
  end;
 writeln(max);
end.

I've tested it. It is allright. But i get WA!!!
Why?
Re: Why WA? I can't understand!
Posted by Михаил 18 Jul 2008 03:16
because you're trying to make set from i = 0 to all of j.
But answer may differ.