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 1005. Stone Pile

help please WA2
Posted by Bobur 2 Dec 2007 10:20
here is code:

    var
      a : array [1..20] of integer;
      y : array [1..2] of integer;
      j, n, min : integer;
   procedure asd(s, x : integer);
     var
       s1, i : integer;

     begin
     i := 1;
     while i <= 2 do
       begin
         if x+1<=n then
           begin
             s1 := abs(s + y[i]*a[x+1]);
             if x+1=n then  begin  if min>s1 then min := s1;  end
             else asd(s1, x+1);
           end
         else inc(i);
         inc(i);
       end;
     end;

begin
  read(n);
  for j := 1 to n do
  read(a[j]);
  min := 100000;
  y[1] := 1;   y[2] := -1;
  asd(a[1], 1);
  writeLn(min);
end.


Can anyone say me where my error is ???

thanks
Re: help please WA2
Posted by 徐老师 12 Aug 2008 14:05
you have a tremendous error ,and i deem that you are a SB!!
Re: help please WA2
Posted by wangjie2008 13 Sep 2008 17:21
I doubt whether a foreignor can understand what does "SB" mean without knowing about Chinese language.