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 1880. Psych Up's Eigenvalues

Crash Test 10
Posted by Alexandr Zhelanov 20 Jan 2013 20:27
Why crash tell me please?
program My;
var
   n,k,i,i2,en,j,count:longint;
   a,b:array [1..4000] of longint;
   block:array[1..3,1..4000]of longint;
   ready:boolean;
begin
en:=1;
     for i:=1 to 3 do
     begin
          readln(n);
          for i2:=1 to n do
          begin
               read(k);
               ready:=true;
               for j:=1 to en do
               begin
                    if k=a[j] then
                    begin
                         ready:=false;
                         if block[i,j]=0 then
                         begin
                              inc(b[j]);
                              block[i,j]:=1;
                         end;
                    end;
               end;
               if ready = true then
               begin
                    a[en]:=k;
                    b[en]:=1;
                    block[i,en]:=1;
                    inc(en);
               end;
          end;
     end;

     for i:=1 to en do
     begin
          if b[i]=3 then inc(count);
     end;
     writeln(count);
end.