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 1128. Partition into Groups

Could anybody help me?My program always get WA!
Posted by TaoZhang 13 Dec 2002 14:27
var
 a:array[1..8000]of 0..1;
 n,m,i,j,k,max,b:integer;

begin
 fillchar(a,sizeof(a),0);
 readln(n);b:=0;
 for i:=1 to n do
  begin
   read(m);max:=0;
   for j:=1 to m do
    begin
     read(k);
     if a[k]=0 then max:=max+1;
    end;
   if max>1 then begin a[i]:=1;b:=b+1;end;
  end;
 if n-b<=b then
 begin
  writeln(n-b);
  for i:=1 to n do
   if a[i]=0 then write(i,' ');
 end else
  begin
   writeln(b);
   for i:=1 to n do if a[i]=1 then write(i,' ');
  end;
end.
Re: Could anybody help me?My program always get WA!
Posted by marius dumitran 27 May 2004 22:59
test 3?
my program looks quite the same
no answer:(