|
|
вернуться в форумHelp, plz! WA 31... program z1354; {$APPTYPE CONSOLE} var mas:array [0..50000] of integer; n,i,j,max:integer; s:string; ch:char; begin s:=''; while not eof do begin read(ch); if ch in ['a'..'z','A'..'Z'] then s:=s+ch; end; n:=length(s); max:=0; for i:=1 to n do begin for j:=n downto i+1 do if s[j]=s[n-i+1] then mas[j]:=mas[j-1]+1 else mas[j]:=0; if mas[n]>max then max:=mas[n]; end; for i:=1 to n do write(s[i]); for i:=n-max downto 1 do write(s[i]); end. Re: Help, plz! WA 31... Have no idea why this happened, but I've got WA 31 with Z-function and instant AC with prefix-function afterwards. O_o Can we somehow get the test 31? Edited by author 04.12.2013 04:59 |
|
|