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

why i get WA on test 7? where is bug? hlp pls
Posted by 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.
Re: why i get WA on test 7? where is bug? hlp pls
Posted by Khlyzov Andrew 6 May 2004 18:15
try this string: aooa
Re: why i get WA on test 7? where is bug? hlp pls
Posted by text2005 16 Nov 2005 17:06
thank you ~i love you very much~~~