|
|
back to boardFor all Who used hash and got WA6 Posted by SP2 25 Sep 2007 20:12 I used hash which have pased all tests I have got WA6 several times here is my program program Project2; {$APPTYPE CONSOLE} const s=['a'..'z','A'..'Z','0'..'9']; var name:array[1..10000000] of boolean; c,n,i,j:longint; ch:char; str:string; begin readln(str); read(ch); if ch='#' then begin writeln('0'); exit; end; while ch <> '#' do begin c:=100*ord(ch); j:=0; while (ch in s)and(ch<>'#') do begin c:=c+ord(ch); read(ch); inc(j); end; name[c]:=true; while (not (ch in s))and(ch <> '#') do read(ch); end; j:=0; for i:=1 to 10000000 do if name[i] then inc(j); writeln(j-1); readln; readln; end. Re: For all Who used hash and got WA6 Only delete readln; readln; And all will be OK! |
|
|