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 1551. Sumo Tournament

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
Posted by Newbies 3 May 2011 20:07
  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 )))