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 1297. Palindrome

Show all messages Hide all messages

why i get WA on test 7? where is bug? hlp pls SolveRusTasks 28 Apr 2004 15:27
{$APPTYPE CONSOLE}
Var
  S,st:AnsiString;
  i,N,d,MaxLen:Integer;
begin
  Readln(S);
  N:=length(S); MaxLen:=0;
  for i:= 1 to N do begin
    d:=0;
   while (i>=d)And((N-i)>=d)And(S[i-d]=S[i+d])do Inc(d);
    if d>MaxLen then begin
      MaxLen:=d;
      st:=Copy(S,i-d+1,d*2-1);
    end;
  end;
  writeln(st);
end.
try this string: aooa
thank you ~i love you very much~~~