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 1354. Palindrome. Again Palindrome

Help, plz! WA 31...
Posted by DixonD (Lviv NU) 5 Mar 2007 02:03
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...
Posted by tchernov 4 Dec 2013 04:59
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