|
|
Can someone send test 6 please? Thanks Yes i can, but you so glup for this 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 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 ))) kakoi v etoi zada4i moget bit` podvoh? u menya na 12 teste valitsa A imena rizni concurentiv? vsem spasibo ^) why can't you talk in english? I think it's not so hard others can take it as an OFFENCE Edited by author 29.10.2007 22:49 I can help with Russian ^ ^ 3 a a b c c b d b e a f c g b h c Right answer: 1 thanks... sorry for my bad english Names of all participants are various? or not? I assumed them various. Although, the names are not important to solve the problem; just the maximum of the number of participants from any place matters. 3 a a b c c b d b e a f c g b h c Right answer: 1 I have WA10. Please, give me some tests. 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. } I don't know why. Can anybody help me? Thanks very much. With array of 1000 elements instead 1024 i got WA on 11-th It is a simple task, i think and it is difficult to make a mistake, but i did it... Do you have some tricky tests? Oh, I found... 2 all: 1 Homasho Ishikawa Tamakasuga Tokyo answer: 1 |
|
|