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 1249. Ancient Necropolis

please give me one test , i get WA in 0.01 sec !!!
Posted by Saber 20 Mar 2003 19:40
here is my prog : please help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{1249}
const maxn=3001;
var
  a,b           : array[0..maxn] of boolean;
  n,m,i,j,k,l,p : integer;
begin
  readln(m,n);
  fillchar(a,sizeof(a),False);
  fillchar(b,sizeof(b),False);
  for i:=1 to n do
    begin
      l:=0;p:=0;
      for j:=1 to m do
        begin
          read(k);
          if k=1 then
          begin
            b[j]:=True;
            if (l=0) then
            begin
            l:=j;
            end
            else
                begin
                  if (a[l]<>a[j]) then
                    begin
                      writeln('NO');halt;
                    end;
                end;
          end
          else
          begin
            b[j]:=False;
            l:=0;
          end;
          if a[j] then
            begin
              if (p=0) then
              begin
                p:=j;
              end
              else
                begin
                  if (b[p]<>b[j]) then
                    begin
                      writeln('NO');halt;
                    end;
                end;
            end
          else
            p:=0;
        end;
      for j:=1 to m do
        a[j]:=b[j];
    end;
  writeln('YES');
end.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SABER
ssf_digi@hotmail.com
Why is your program so <b>complicated</b> ??? mine took only 21 lines and 10 minutes to write :P !?
Posted by uuuuuuu 25 Mar 2003 22:22
Why is your program co complicated ??? mine took only 21 lines !?