|
|
вернуться в форумI need help Послано Wolf 8 дек 2007 01:40 what the answer if names who not equally; for q div 2 my programm give wa 6. please help. Or give me some tests. my wa programm {var a:array[0..100] of string; z:string; n,q,i,j:word; Begin {$IFNDEF ONLINE_JUDGE} assign(input, 'd:\input.txt'); reset(input); {$ENDIF} Readln(N); q:=1; For I:=1 to n do q:=q*2; n:=q; For I:=1 to n do Begin Readln(Z); For q:=1 to length(Z) do If Z[q]=' ' Then Delete(Z,1,q); j:=j+1;A[j]:=Z;z:=''; End; q:=0; For i:=1 to n do Begin For J:=i+1 to n do if (a[i]=a[j]) and (a[i]<>'') Then Begin A[j]:=''; q:=q+1; End; If q<>0 Then A[i]:=''; Q:=0; End; For I:=1 to N do if a[i]<>'' Then q:=q+1; if q mod 2<>0 then Writeln(q div 2); {$IFNDEF ONLINE_JUDGE} close(input); {$ENDIF} End. } |
|
|