Problem: A string S of an odd length is said to be a _strong palindrome_ if and only if all of the following conditions are satisfied:    * S is a palindrome.   * Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.   * The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.  Determine whether S is a strong palindrome.

Submission attempts (in order):
import sys
s = sys.stdin.readline()
i = 0
l = len(s)
flag = True
while flag and i <= l:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:(l-1)/2]
i = 0
l = len(a)
while flag and i <= l:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)/2 - 1:]
i = 0
l = len(b)
while flag and i <= l:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')


import sys
s = sys.stdin.readline()
i = 0
l = len(s)
flag = True
while flag:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:(l-1)/2 - 1]
i = 0
l = len(a)
while flag:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)/2 - 1: -1]
i = 0
l = len(b)
while flag:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')

import sys
s = sys.stdin.readline()
i = 0
l = len(s)
flag = True
while flag and i <= l:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:(l-1)//2]
i = 0
l = len(a)
while flag and i <= l:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)//2 - 1:]
i = 0
l = len(b)
while flag and i <= l:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')


S = input()
n = 0
def judge(s):
  i = 0
  N = len(s)
  while i < (N-1) / 2
    if S[i] != S[N-1]:
      break
    elif i == (N-1)/2:
      n += 1
      break
    else:
      i += 1
judge(S)
judge(S[0 : (len(S)-3)/2])
judge(S[(len(S)+1)/2] : len(S)-1)

if n == 3:
  print("Yes")
else:
  print("No")

import sys
s = sys.stdin.readline()
i = 0
l = len(s)
flag = True
while flag and i <= l:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:-(-(l-1)//2)]
i = 0
l = len(a)
while flag and i <= l:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)//2 - 1:]
i = 0
l = len(b)
while flag and i <= l:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')


S = input()
N = len(S)
n = 0
i = 0

while i < (N-1) / 2
  if S[i] != S[N-1]:
    break
  elif i == (N-1)/2:
    n += 1
    break
  else:
    i += 1
    
s = S[:(N-3)/2]
l = len(s)
i = 0

while i < (l-1) / 2
  if s[i] != s[l-1]:
    break
  elif i == (N-1)/2:
    n += 1
    break
  else:
    i += 1
    
S = S[(N+1)/2:]
i = 0
while i < (l-1) / 2
  if S[i] != S[l-1]:
    break
  elif i == (l-1)/2:
    n += 1
    break
  else:
    i += 1

if n == 3:
  print("Yes")

S = input()
n = 0
def judge(s):
  i = 0
  N = len(s)
  while i < (N-1) / 2:
    if S[i] != S[N-1]:
      break
    elif i == (N-1)/2:
      n += 1
      break
    else:
      i += 1
judge(S)
judge(S[0 : (len(S)-3)/2])
judge(S[(len(S)+1)/2] : len(S)-1)

if n == 3:
  print("Yes")
else:
  print("No")

import sys
s = sys.stdin.readline().rstrip()
i = 0
l = len(s)
flag = True
while flag and i <= l:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:-(-(l-1)//2)]
i = 0
l = len(a)
while flag and i <= l:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)//2 - 1:]
i = 0
l = len(b)
while flag and i <= l:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted