|
|
вернуться в форумWA#5 Can you give me some test, please! Here is my code, I do not know, where can here mistake be!!!
type smalls=string[30]; var s:smalls; a:array[1..1024]of smalls; k:array[1..1024]of longint; n,i,j,max:longint; begin readln(n); max:=1; for i:=1 to n do max:=max*2; n:=max; max:=1; for i:=1 to n do begin readln(s); s:=copy(s,pos(' ',s)+1,length(s)); j:=1; while ((a[j]<>'') and (a[j]<>s)) do begin inc(j); end; if (a[j]<>s) then a[j]:=s; inc(k[j]); if (k[j]>k[max]) then max:=j; end; i:=0; while (k[max]<=n div 2) do begin n:=n div 2; inc(i); end; write(i); end.
Sorry for my bad english!!! Edited by author 18.12.2007 15:00 Re: WA#5 smalls=string[30]---> smalls=string[100]... a:array[1..1024]of smalls---->a:array[1..1100]of smalls k:array[1..1024]of longint--->k:array[1..1100]of longint Lmrs +1 ))) |
|
|