This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
a=str(input())
def palin(s):
if s==s[::-1]:
return True
return False
def cou(s,el):
ret=0
for i in range(len(s)):
c=0
for j in range(len(el)):
if i+j<len(s):
if s[i+j]==el[j]:
c+=1
if c==len(l):
ret+=1
return ret
ans=[]
for i in range(len(a)):
for j in range(len(a)):
l=a[i:j+1]
k=palin(l)
if k:
ans.append(len(l)*(cou(a,l)))
print(max(ans))
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |