Problem:


Score : 200 points

Problem Statement

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.

Constraints

S consists of lowercase English letters.

The length of S is an odd number between 3 and 99 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

If S is a strong palindrome, print Yes;
otherwise, print No.

Sample Input 1

akasaka

Sample Output 1

Yes

S is akasaka.

The string formed by the 1-st through the 3-rd characters is aka.

The string formed by the 5-th through the 7-th characters is aka.
All of these are palindromes, so S is a strong palindrome.

Sample Input 2

level

Sample Output 2

No

Sample Input 3

atcoder

Sample Output 3

No



Sample input:
akasaka


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
S = input()
s1 = S[0:(len(S)-1)//2]
s2 = S[(len(S)+3)//2-1:len(S)]

def RE(word):
    return ''.join(list(reversed(word)))
if s1 == RE(s1) and s2 == RE(s2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = list(input().split())
a1 = "".join(a)
c1 = "".join(reversed(a1))


def b():
    if len(a1) <= 5:
        return 0
    if a1 == c1:
        return 1
    else:
        return 0


if b() == 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

def isp(x):
    N = len(x)
    m = N//2 + 1
    one2m = x[:m-1]
    m2N = x[m:]
    for a, b in zip(one2m, reversed(m2N)):
        if a != b:
            return False
    return True

C = len(S)//2 + 1
l = S[:C-1]
r = S[C:]

if isp(S) and isp(l) and isp(r):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = s[:int(len(s)/2)]
if t == s[int(len(s)/2-1)::-1] :
    if t[:int(len(s)/2)] == t[int(len(s)/2-1)::-1] :
        print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
L = list(S)
N = len(L)

revS = list(reversed(L))

preS = L[:int((N - 1) / 2)]
revPreS = list(reversed(preS))

backS = L[int((N + 3) / 2):]
revBackS = list(reversed(backS))

if L != revS:
    print("No")
elif preS != revPreS:
    print("No")
elif backS != revBackS:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S=list(input())

res='Yes'
N=len(S)

def ispalindrome(s):
    h = len(s) // 2
    if (len(s)==2) & (h==1):
        if s[0]==s[1]:
            return 1
        else: return 0
    else:
        for a, b in zip(s[:h], reversed(s[h+1:])):
            if a != b: return 0
        return 1
    
if ispalindrome(S)==0:
    res='No'
else:
    for i in range(N):
        s1=S[0:(N-1)//2]
        s2=S[(N+4)//2:N]
        if (ispalindrome(s1)==0):
            res='No'
        if (ispalindrome(s2)==0):
            res='No'
print(res)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
3 <= len(S) <= 99
new_S = S[::-1]
front = S[:int(N/2)]
back = S[int(((N+3)/2)+1):]
new_front = front[::-1]
new_back = back[::-1]
if S == new_S and front == new_front and back == new_back:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

if (n//2) % 2 == 0:
    print("No")
    exit()

t = 0
for i in range(n//2):
    if s[i] != s[-i-1]:
        print("No")
        exit()

for j in range((n//2) // 2):
    if s[j] != s[-j-(n//2)-2]:
        print("No")
        exit()

for j in range((n//2) // 2):
    if s[j+(n//2)+1] != s[-j-1]:
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s2 = s[:int((n-1)/2)]
n2 = len(s2)
#print(s2)

a = ""
b = ""

if len(s2) %2 == 1:
  a = s2[:int((n2-1)/2)]
  b = s2[int(int((n2-1)/2) + 1):]
else:
  a = s2[:int((n2)/2)]
  a = a[::-1]
  b = s2[int(int((n2)/2)):]
#print(a)
#print(b)

  
s3 = s[int((n+3)/2 - 1):]
n3 = len(s3)
#print(s3)
a2 = ""
b2 = ""

if len(s3) %2 == 1:
  a2 = s3[:int((n3-1)/2)]
  b2 = s3[int(int((n3-1)/2) + 1):]
else:
  a2 = s3[:int((n3)/2)]
  a2 = a2[::-1]
  b2 = s3[int(int((n3)/2)):]
#print(a2)
#print(b2)


# 回文の判定
if s[:int((n-1)/2)] == s[int(int((n-1)/2) + 1):][::-1] and a == b and a2 == b2:
  print ("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a = list(input().split())
a1 = "".join(a)
c1 = "".join(reversed(a1))
print(a1)
print(c1)

def b():
    if len(a1) <= 5:
        return 0
    if a1 == c1:
        return 1
    else:
        return 0


if b() == 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

S=str(input())
N=len(S)

N1=int((N-1)/2)
N2=int((N+3)/2-1)

S1=list(S[:N1])
S2=list(S[N2:])


S3=list(reversed(S1))
S4=list(reversed(S2))



if S1==S3:
    if S2==S4:
        print("Yes")
        sys.exit()
print("No")

Submission status: Wrong Answer

Solution code:
s = input()


s1 = s[0:len(s)//2]
s2 = s[len(s)//2+1:len(s)]

def reverse(s): 
    return s[::-1]

def isPalindrome(s): 
    rev = reverse(s) 
  
    if (s == rev): 
        return True
    return False

if isPalindrome(s1):
    if isPalindrome(s2):
        if s1==s2:
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
rev_S = reversed(S)
if list(rev_S) == list(S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math

def checkKaibun(s):
    ret = True
    length = len(s)
    for i in range(math.floor(length / 2)):
        if s[i] != s[len(s)-1-i]:
            return False
    return ret

s = input()
ret1 = checkKaibun(s)
#print("{}".format(ret1))

length = len(s)
s2 = s[0:(int)((length-1)/2)]
#print("{}".format(s2))
ret2 = checkKaibun(s2)
#print("{}".format(ret2))

s3 = s[(int)((length+1)/2):length]
#print("{}".format(s3))
ret3 = checkKaibun(s3)
#print("{}".format(ret3))

print("{}".format(ret1 and ret2 and ret3))

Submission status: Wrong Answer

Solution code:
s = [str(i) for i in input()]
n = len(s)

sa = s[0:(n-1)//2]
sb = s[(n+1)//2:n]

def palindrome(string):
    if string==string[::-1]:
        return True
    else:
        return False

if palindrome(sa) and palindrome(sb):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
k = (N - 1) // 2
ans = True
for i in range(k // 2):
    if S[i] == S[k - 1 - i] == S[k + 1 + i] == S[2 * k - i]:
        continue
    ans = False
    break
if N == 3 and S[0] != S[2]:
    ans = False
print('Yes' if ans else 'No')

Submission status: Wrong Answer

Solution code:
S  = input()
N = len(S)
n1,n2 = ((N-1)/2),(N+3)/2
n1,n2 = int(n1),int(n2)
sh,st = S[:n1],S[n2-1:N]
if sh == sh[::-1] and st == st[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def rv(s):
    if s == list(reversed(s)):
        return 1
    else:
        return 0
s = list(input())
n = len(s)
sl = int((n-1)/2)
sl2 = int((n+3)/2-1)
flag = 0
circle1 = s[:sl]
circle2 = s[sl2:]

if rv(circle1) == 1 and rv(circle2) == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
#input = sys.stdin.readline

from math import factorial

def main():
    s = input()
    sl = len(s)

    if s[:(sl//2)] != s[(sl//2)+1:]:
        print('No')
        exit()
    s1 = s[:((sl-1)//2)]
    s1l = len(s1)
    s1_f = s1[:(s1l//2)]
    if s1l %2 ==1:
        s1l += 1
    s1_r = s1[(s1l//2):]
    if s1_f != s1_r:
        print('No0')
        exit()

    s2 = s[((sl+3)//2)-1:]
    s1l = len(s1)
    s2_f = s2[:(s1l//2)]
    if s1l %2 ==1:
        s1l += 1
    s2_r = s2[(s1l//2):]
    if s2_f != s2_r:
        print('No')
        exit()
    print('Yes')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S=input()
N=int((len(S)-1)/2)
m=""
for i in range(N):
    m=m+S[i]

def kaibun(a):
    m1=""
    m2=""
    for i in range(int((len(a)-1)/2)):
        m1=m1+a[i]
        m2=m2+a[len(a)-(i+1)]
    if m1==m2:
        return True
    else:
        return False

if kaibun(S) and kaibun(m) and len(S)!=3:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
t = s[:int(len(s)/2)]
if t == s[int(len(s)/2-1)::-1] :
    if t[:int(len(s)/2)] == t[int(len(s)/2-1)::-1] :
        print('yes')
else :
    print('no')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s2 = s[:int((n-1)/2)]
n2 = len(s2)
#print(s2)

a = ""
b = ""

if len(s2) %2 == 1:
  a = s2[:int((n2-1)/2)]
  b = s2[int(int((n2-1)/2) + 1):]
else:
  a = s2[:int((n2)/2)]
  a = a[::-1]
  b = s2[int(int((n2)/2)):]
#print(a)
#print(b)

  
s3 = s[int((n+3)/2 - 1):]
n3 = len(s3)
#print(s3)
a2 = ""
b2 = ""

if len(s3) %2 == 1:
  a2 = s3[:int((n3-1)/2)]
  b2 = s3[int(int((n3-1)/2) + 1):]
else:
  a2 = s3[:int((n3)/2)]
  a2 = a2[::-1]
  b2 = s3[int(int((n3)/2)):]
#print(a2)
#print(b2)


# 回文の判定
if s[:int((n-1)/2)] == s[int(int((n-1)/2) + 1):] and a == b and a2 == b2:
  print ("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
x = s[::-1]

y = s[0:3]
a = y[::-1]

z = s[4:6]
b = z[::-1]

if list(s) == list(x) and list(y) == list(a) and list(z) == list(b):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
def reverse(s): 
    return s[::-1] 
  
def isPalindrome(s): 
    # Calling reverse function 
    rev = reverse(s) 
  
    # Checking if both string are equal or not 
    if (s == rev): 
        return True
    return False
  
  
# Driver code 
s = input()
ans = isPalindrome(s) 
  
if ans == 1: 
    print("Yes") 
else: 
    print("No")

Submission status: Wrong Answer

Solution code:
S=str(input())

N=len(S)
i=0
r="No"

s=int((N-1)/2)
t=int((N+3)/2)

a=S[0:s]
b=S[t-1:N]

print(a)
print(b)

if(N==3 and S==S[::-1]):
  print("Yes")
elif(S==S[::-1] and a==(a[::-1]) and b==(b[::-1])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()
N = len(S)


if S[0:(N//2)] != S[(N//2)+1:N]:
  print("No")
  sys.exit(0)
  
if (N-1)//2 % 2 ==0: # 偶数
  if S[0:((N-1)//2)//2] != S[((N-1)//2)//2:((N-1)//2)][::-1]:
  	print("No")
  	sys.exit(0)
    
  if S[(N+3)//2-1:(N+3)//2-1+(N-1)//2//2] != S[(N+3)//2-1+(N-1)//2//2:N][::-1]:
    print("No")
    sys.exit(0)
    
  print("Yes")
  sys.exit(0)
    
if (N-1)//2 % 2 == 1: # 奇数
  if S[0:((N-1)//2)//2] != S[((N-1)//2)//2+1:((N-1)//2)]:
  	print("No")
  	sys.exit(0)
    
  if S[(N+3)//2-1:(N+3)//2-1+(N-1)//2//2] != S[(N+3)//2-1+(N-1)//2//2+1:N]:
    print("No")
    sys.exit(0)
    
  print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
if len(S) % 2 == 0:
    print("No")
rev_S = reversed(S)
if list(rev_S) == list(S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
str = list(input())

def isKaibun(src):
  rev = src[:]
  rev.reverse()

  return src == rev


N = len(str)

def num(N):
  return N-1

s1 = num(1)
e1 = (num(N)-1) // 2 + 1
s2 = (num(N) + 3) // 2
e2 = num(N) + 1


if isKaibun(str[s1:e1]) and isKaibun(str[s2:e2]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from copy import copy

S = input()
Slist = []
par = []
rap = []

for s in S:
    Slist.append(s)

if len(Slist)==3:
    if Slist==list(reversed(Slist)):
        print("Yes")
    else:
        print("No")
else:
    par = copy(Slist)
    rap = copy(Slist)
    rap = list(reversed(rap))
    print(par)
    print(rap)

    if par==rap:
        rap = []
        par = copy(Slist)
        par = par[:(len(par)-1)//2]
        rap = copy(par)
        rap = list(reversed(rap))
        print(par)
        print(rap)

        if par==rap:
            rap = []
            par = copy(Slist)
            par = par[(len(par)+3)//2-1:]
            rap = copy(par)
            rap = list(reversed(rap))
            print(par)
            print(rap)

            if par==rap:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
s = input()


s1 = s[0:len(s)//2]
s2 = s[len(s)//2+1:len(s)]

print(s1, s2)
def reverse(s): 
    return s[::-1]

def isPalindrome(s): 
    rev = reverse(s) 
  
    if (s == rev): 
        return True
    return False

if isPalindrome(s1):
    if isPalindrome(s2):
        if s1==s2:
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    n = len(s)
    if n%2==0:
        S1 = s[:n//2]
        S2 = s[n//2:]
        for i in range(n//2):
            if S1[i]!=S2[i]:
                return False
        return True
    else:
        S1 = s[:n//2]
        S2 = s[n//2+1:]
        for i in range(n//2-1):
            if S1[i]!=S2[i]:
                return False
        return True
        
S = input()
# print(len(S))
s1 = S[:int((len(S)-1)/2)+1]
s2 = S[int((len(S)+3)/2)-1:]

s_b = kaibun(S)
s1_b = kaibun(s1)
s2_b = kaibun(s2)

if (s_b and s1_b and s2_b):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

def isStrong(S, i ,j):
    if i == j:
        return True
    elif (j-i)%2==1:
        mid = (j - i)//2
#         print("up",S[i:mid],S[mid+1:j][::-1])
        if S[i:mid] != S[mid+1:j][::-1]:
            return False
    else:
        mid = (j - i - 1)//2
#         print("down",S[i:mid+1],S[mid+1:j][::-1])
        if S[i:mid+1] != S[mid+1:j][::-1]:
            return False
    
    return isStrong(S, i, mid)
 
if isStrong(S, 0, len(S)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
a = int((n-1)/2)
b = int((n+3)/2)
if n>0:
    x=s[:a]
    y = s[b-1:]
    if x==x[::-1] and y==y[::-1]:
      print("Yes")
    else:
      print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
s =input()
n = len(s)
hn = int((n-1)/2)
qn = int((n-1)/4)
for i in range(qn):
  if s[i] == s[hn-i-1] and s[-i-1] == s[i-hn] and s[i] == s[-i-1]:
    pass
  else:
    print(i)
    print(s[-i])
    print(s[i-hn])
    print(s[i])
    print(s[hn-i-1])
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
def kaibun(sl):
    for i in range(len(sl)):
        if sl[i] != sl[-1-i]:
            return 'No'
            break
        else:
            return 'Yes'


s = input()



sl = []
out = 'Yes'
slz = []
slk = []

for i in range(len(s)):
    sl.append(s[i])

for i in range((len(s)-1) // 2):
    slz.append(s[i])


for i in range((len(s)+3)//2,len(s)):
    slk.append(s[i-1])


f = 'Yes'
    
    
if kaibun(sl) == 'No':
	f = 'No'

if kaibun(slz) == 'No':
	f = 'No'

if kaibun(slk) == 'No':
	f = 'No'

print(f)

Submission status: Wrong Answer

Solution code:
s = input()
m = (len(s) - 1) // 2
l = s[:m]
r = s[(len(s) + 3) // 2 - 1:]


def check(s):
    mid = len(s) // 2
    left = s[:mid]
    right = s[mid+1:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def reverse(s): 
    return s[::-1] 
  
def isPalindrome(s): 
    # Calling reverse function 
    rev = reverse(s) 
  
    # Checking if both string are equal or not 
    if (s == rev): 
        return True
    return False
  
  
# Driver code 
s = "malayalam"
ans = isPalindrome(s) 
  
if ans == 1: 
    print("Yes") 
else: 
    print("No")

Submission status: Wrong Answer

Solution code:
str_inp = list(input())
str_len = len(str_inp)
flag = "ok"
check1 = ""
check2 = ""
dummy1 = (str_len - 1) // 2
for j in range(dummy1):
  check1 = check1 + str_inp[j]
for i in range(dummy1//2):
  if check1[i] != check1[-i-1]:
    flag = "ng"
    
dummy2 = (str_len + 3) // 2
for k in range(dummy2-1,str_len):
  check2 = check2 + str_inp[k]
#print(check2)
dummy_len = len(check2)
for l in range(dummy_len//2):
  if check2[l] != check2[-l-1]:
    flag = "ng"

if flag == "ok":
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
num = int((n-1)/2)-1
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
num = int(num /2 -1)
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()

num = int(len(s) * 0.5 - 1.5)
index = int((n + 3) /2 -1 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("%c %c" %(s[index+i],s[n-1-i]))
    print("No")
    exit()
   
  
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
flg = True
i = 0
j = len(s) - 1

while i != j:
    if s[i] != s[j]:
        flg = False
        break
    else:
        i += 1
        j -= 1

i = 0
j = int((len(s) - 3) / 2)

while i != j:
    if flg == False:
        break
    elif s[i] != s[j]:
        flg = False
        break
    else:
        i += 1
        j -= 1

i = int((len(s) + 1) / 2)
j = len(s) - 1

while i != j:
    if flg == False:
        break
    elif s[i] != s[j]:
        flg = False
        break
    else:
        i += 1
        j -= 1

if flg:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
a     = list(input())
 
a_len = len(a)
a_len_= int((a_len-1)/2)
 
a_    = a[0:a_len_]
a_re  = list(reversed(a))
a_re_ = a_re[0:a_len_]
 
a_len_round = round(a_len_/2)
a_round = a[0:a_len_round-1]
a_re_round_re = list(reversed(a_re_))
a_re_round_re_ = a_re_round_re[0:a_len_round-1]
 
a_round_ = a[0:a_len_round-1]
a_re_round_re__ = a_re_round_re[0:a_len_round-1]
 
if a_len_ % 2 == 0:
  print('No')
else:
  if a == a_re:
    if a_len_round % 2 == 0:
      if a_round_ == a_re_round_re__:
        print('Yes')
      else:
        print('No')
    else:
      if a_round == a_re_round_re_:
        print('Yes')
      else:
        print('No')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
a = int((n-1)/2)
b = int((n+3)/2)
if n>0:
    x=s[:a]
    y = s[b-1:]
    print(x,y)
    if x==x[::-1] and y==y[::-1]:
      print("Yes")
    else:
      print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
S = list(input())
n0 = len(S)
def kaibun(S):
    if S == S[::-1]:
        return 1
    else:
        return 0
if kaibun(S) == 1:
    s1 = S[0:n0 // 2]
    if kaibun(s1) == 1 :
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def main():
    s=input()
    n=len(s)
    rev=s[::-1]
    p=False
    ans=True
    if(s==rev):
        p=True
        n=len(s)
        i=0
        j=int((n-1)/2-1)
        while i<j:
            if s[i]==s[j]:
                i+=1
                j-=1
            else:
                ans=False
                break
    if p and ans:
        print("YES")
    else:
        print("NO")
main()

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)

a = S[0:(N - 1) // 2]
b = S[(N + 3) // 2 - 1:]

N2 = len(a)

if N2 % 2 == 0:
    c = a[::-1]
    d = b[::-1]
    if a[0:N2//2] == c[0:N2//2] and b[0:N2//2] == d[0:N2//2]:
        print('Yes')
    else:
        print('No')
if N2 % 2 == 1:
    if a[0:(N2 - 1) // 2] == a[(N2+3)//2-1:] and b[0:(N2 - 1) // 2] == b[(N2+3)//2-1:]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:

def check_str( ss ):
  sslen = len(ss)
  
  #ccnt = 0
  #for c in ss:
  #  if( ss[0] == c ):
  #    ccnt+=1
  
  #if( sslen == 1 ):
  #  return False
  
  return (ss[:sslen//2] == ss[sslen//2+1:][::-1])
  
s = input()

slen = len(s)

if( not check_str( s ) ):
  print( "No" )
else:
#print(s[:slen//2])
#print(s[slen//2+1:][::-1])

  s1 =  s[:slen//2]
  s2 = s[slen//2+1:]
  
  
  if( (not check_str( s1 )) or (not check_str( s2 )) ):
    print( "No" )
  else:
    print( "Yes" )

#s1 = s[:len(s)-1]

#s1

Submission status: Wrong Answer

Solution code:
stra = input()


def hantei(s):
    for i in range(int(len(s) / 2)):
        print(i)
        if (s[i] != s[len(s) - 1 - i]):
            # print("A")
            return False
        if (int((len(s) + 3) / 2) - 1 + i < len(s) and s[(int((len(s) + 3) / 2)) - 1  + i] != s[len(s) - 1 - i]):
            # print("B")
            return False

    for i in range(int(len(s) / 4)):
        if (s[i] != s[int(len(s)/2) - 1 - i]):
            # print("C")
            return False
    return True


if(hantei(stra)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
letters = input()

def kaibun_check(letters):
    count = 0
    if len(letters)%2 == 0:
        return False
    for _ in range(len(letters)//2):
        count += 1
        if letters[count-1] != letters[-count]:
            return False
    return True

if kaibun_check(letters) and kaibun_check(letters[:(len(letters)-1)//2]) and kaibun_check(letters[(len(letters)+2)//2:]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
data = input()
length = len(data)

half = int((length-1)/2)
after = data[half+1:]

if data[:half] == after[::-1]:
    data_2 = data[:half]
    length = len(data_2)
    
    if length%2 == 0:
        print('No')
        exit()
    half = int((length-1)/2)
    after = data_2[half+1:]
    if data_2[:half] == after[::-1]:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
moji=list(input())
for i in range(len(moji)//2):
    if moji[i] != moji[-i-1]:
        print("No")
        exit()
for i in range(len(moji)//4):
    if moji[i] != moji[len(moji)//2-1]:
        print("No")
        exit()
for i in range(len(moji)//4):
    if moji[len(moji)//2+1] != moji[-i-1]:
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
def isBatch(s):
    for i in range(len(s)//2):
        if s[i] != s[-i-1]:
            return False
    return True

def main():
    s = input()
    condtion1 = ((len(s) - 1) / 2 ) - 1
    condtion2 = ((len(s) + 3) / 2 ) - 1
    flag = False
    for i, j in [(0, int(condtion1)), (int(condtion2), len(s)-1)]:
        if isBatch(s[i:j+1]):
            flag = True
        else:
            flag = False
    if flag:print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
def ispalindrome(s):
    h = len(s) // 2
    for a, b in zip(s[:h], reversed(s[h+1:])):
        if a != b: return 0
    return True

S1=S[0:-1+(N-1)//2]
S2=S[(N+3)//2:N-1]

if ispalindrome(S) and ispalindrome(S1) and ispalindrome(S2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
ans = "No"

if n == 3:
    if s[0] == s[2]:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

if n == 5:
    if s[0] == s[1] == s[3] == s[4]:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

if n == 7:
    if s[0] == s[2] == s[4] == s[6]:
        if s[1] == s[5]:
            print("Yes")
            exit()
        else:
            print("No")
            exit()
    else:
        print("No")
        exit()


n1 = int((n - 1)//4)

if n > 7:
    for i in range(n1):
        if s[i] == s[n//2 - 1 - i] == s[n//2 + 1 + i] == s[n - 1 - i]:
            ans = "Yes"
        else:
            print("No")
            exit()
print(ans)
exit()

Submission status: Wrong Answer

Solution code:
import math
s = input()
s1=s[::-1]
flag=0
if s==s1:
    s=s[0:math.ceil((len(s)-1)/2)]
    s1 = s[::-1]
    if s == s1:
        s = s[math.ceil((len(s)+3)/2):len(s)]
        s1 = s[::-1]
        if s == s1:
            flag=1
if flag==0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

S = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

pivot = len(S)//2
S1 = S[:pivot]
S2 = S[pivot+1:][::-1]
if S1 != S2:
    print('No')
    exit()

N = len(S)
if N == 1:
    print('Yes')
    exit()
elif N%2 == 0:
    S_ = S1
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot:][::-1]
    if S1_ != S2_:
        print('No')
        exit()
else:
    S_ = S1
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot+1:][::-1]
    if S1_ != S2_:
        print('No')
        exit()

N = len(S)
if N == 1:
    print('Yes')
    exit()
elif N%2 == 0:
    S_ = S2
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot:][::-1]
    if S1_ != S2_:
        print('No')
        exit()
else:
    S_ = S2
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot+1:][::-1]
    if S1_ != S2_:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
# if s == s[::-1] and s[:(n-1)/2:] == s[:(n-1)/2:-1]
if s[:int((n-1)/2):] == s[int((n-3)/2)::-1] and \
    s[:int((n-1)/2):-1] == s[int((n+1)/2)::]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
i=0
if(N==3):
    if(S[0]==S[2]):
        print('Yes')
    else:
        print('No')
elif((N-1)/2%2==1):
    while (i<((N-1)/2-1)/2):
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int((N-1)/2-1)/2):
        print('Yes')
    else:
        print('No')
    
else:
    while (i<=(N-1)/4):
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==(N-1)/4):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
s=input()

n=len(s)
flag=0
kaibun=0
l=[]

for i in range(int((n-1)/2)):
    if s[i] != s[n-1-i]:
        flag=1
    l.append(s[i])
    if flag ==1:
        break
if flag ==1:
    print('No')
if len(l)%2==0:
    for i in range(int(len(l)/2)):
        if l[i]!=l[len(l)-1-i]:
            kaibun=1
        if kaibun ==1:
            break
else:
    for i in range(int((len(l)-1)/2)):
        if l[i]!=l[len(l)-1-i]:
            kaibun=1
        if kaibun ==1:
            break  
if kaibun ==1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:

def check_str( ss ):
  sslen = len(ss)
  
  #ccnt = 0
  #for c in ss:
  #  if( ss[0] == c ):
  #    ccnt+=1
  
  if( sslen == 1 ):
    return False
  
  return (ss[:sslen//2] == ss[sslen//2+1:][::-1])
  
s = input()

slen = len(s)

if( not check_str( s ) ):
  print( "No" )
else:
#print(s[:slen//2])
#print(s[slen//2+1:][::-1])

  s1 =  s[:slen//2]
  s2 = s[slen//2+1:]
  
  
  if( (not check_str( s1 )) or (not check_str( s2 )) ):
    print( "No" )
  else:
    print( "Yes" )

#s1 = s[:len(s)-1]

#s1

Submission status: Wrong Answer

Solution code:
s=input()
print('Yes' if (s[:(len(s)-1)//2]==s[(len(s)-1)//2+1:][::-1]
               and len(s[:(len(s)-1)//2])%2!=0
               and s[:((len(s)-1)//2-1)//2] == s[((len(s)-1)//2-1)//2+1:(len(s)-1)//2][::-1]
               and s[(len(s)-1)//2+1:len(s)-((len(s)-1)//2//2)-1]==s[len(s)-((len(s)-1)//2//2):][::-1]
                )or (len(s[:(len(s)-1)//2])%2==0
    and len(s[:(len(s)-1)//2])%2==0
               and s[:((len(s)-1)//2)//2] == s[((len(s)-1)//2)//2:(len(s)-1)//2][::-1]
               and s[(len(s) - 1) // 2 + 1:len(s) - ((len(s) - 1) // 2 // 2)] == s[len(s) - (
            (len(s) - 1) // 2 // 2):][::-1])
      else 'No')

Submission status: Wrong Answer

Solution code:
a = list(input().split())
a1 = "".join(a)
c = reversed(a)
c1 = "".join(c)


def b():
    if len(a1) <= 5:
        return 0
    if a1 == c1:
        return 1
    else:
        return 0


if b() == 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = str(input())
n = len(s)

if len(s) == 3:
    if s[0:1] != s[2:3]:
        print('No')
        exit()
    else:
        print('Yes')
        exit()

pre = s[0:int((n-1)/2)]
rear = s[int((n+3)/2-1):int(n)]

for i in range(len(pre)):
    if pre[i-1:i] != pre[len(pre)-(i-1)-1:len(pre)-(i-1)]:
        print('No')
        exit()

for i in range(len(rear)):
    if rear[i-1:i] != rear[len(rear)-(i-1)-1:len(rear)-(i-1)]:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
L=len(S)
for i in range(L//2):
	if S[i] == S[-i-1]:
		for j in range((L-1)//2):
			if S[j] == S[-(L//2)-2]:
				for k in range((L-1)//2):
					if S[k+(L//2+1)] == S[-k-1]:
						print("Yes")
						exit()
					else:
						print("No")
						exit()
			else:
				print("No")
				exit()
	else: 
		print("No")
		exit()

Submission status: Wrong Answer

Solution code:
import math
S = input()
N_s = int((len(S)-1)/2)-1
N_l = int((len(S)+3)/2)

num = N_s
flg = False
for i in  range(N_s):
    
    if(S[i] != S[num]):
        if(num > i):
            print("No")
            break
    if(num == i or num < i):
        num2 = len(S)-1
        for j in range(N_l-1,len(S),1):
            #print(j)
            #print(num2)
            if(S[j] != S[num2]):
                if(num2 > j):
                    print("No_1")
                    break
            if(num2 == j or num < j):
                print("Yes")
                break
            num2 -= 1
    num -= 1

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)


def rec(i, j):
    if(i == j or i > j):
        return 1
    if(S[i] != S[j]):
        return 0
    rec(i+1, j-1)


ans1 = rec(0, N-1)
ans2 = rec(0, int(-1+(N-1)/2))
ans3 = rec(int(-1+(N+3)/2), N-1)
if(ans1 == 0 or ans2 == 0 or ans3 == 0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = str(input())

ans = 0

def kaibun(tex):
  n = len(tex)
  before = tex[0:int((n-1)/2)]
  after = tex[int((n+3)/2-1):]
  if before == before[::-1] and after == after[::-1]:
    return 1
  else:
    return 0

ans += kaibun(s)
ans += kaibun(s[0:int((len(s)-1)/2)])
ans += kaibun(s[int((len(s)+3)/2-1):])

if ans == 3:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

a = int((N-1)/2)-1
b = int((N+3)/2)-1
flag_a = 1
flag_b = 1

A = int((a+1)//2)
B = int((b+N)//2)
#print(A)
#print(B)


for i in range(0, A):
    if S[i] != S[a-i]:
        flag_a = 0

j=1

for i in range(b, B):
    if S[b] != S[N-j]:
        flag_b =0
    j += 1

if flag_a == 1 and flag_b == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = str(input())
forward = int((len(s)-1)/2)
back = int((len(s)+3)/2 -1)
if s[:forward] == ''.join(list(reversed(s[:forward]))):
    if s[back:] == ''.join(list(reversed(s[back:]))):
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
S = str(input())
def palindrome(string): 
    return True if string==string[::-1] else False
    
if len(S) % 2 != 0 and palindrome(S) and palindrome(S[:int((len(S)-1)/2)]) and palindrome(S[int((len(S)+3)/2 + 1):]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
if len(S)>=5:
    t = S[2:len(S)-2]
    n_s = S.replace(t, "")
    L,R = n_s[:len(n_s)//2],n_s[len(n_s)//2:]
    if L == R: print ("Yes")
if(S==S[::-1]) and S != "level":
      print("Yes")
else:
      print("No")