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:
import sys

S = input()
N = len(S)
half = N // 2

f = S[:half]
r = S[-half:][::-1]

if f != r:
    print("No")
    sys.exit(0)

S = f
N = len(S)
half = N // 2

f = S[:half]
r = S[-half:][::-1]

if f != r:
    print("No")
    sys.exit(0)

print("Yes")

Submission status: Wrong Answer

Solution code:
# function which return reverse of a string
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 = str(input())
ans = isPalindrome(S)

if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
n = len(s)
N = int((n-1)/2)
M = int((n+3)/2)
l = []
m = []
for i in range(N):
    l.append(s[i])
for i in range (M-1,N):
    m.append(s[i])
a = ''.join(l)
b = ''.join(m)
l.reverse()
m.reverse()
A = ''.join(l)
B = ''.join(m)
t = s
t.reverse()
x = ''.join(s)
y = ''.join(t)
if (a==A and b==B and x == y):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
n1 = int((n-1)/2)
n2 = int((n+3)/2)
def check1(s,a):
  data = True
  num = 1
  for i in range(0, a):
    if s[i] != s[a-num]:
      data = False
      break
    num += 1
  return data

def check2(s,a):
  data = True
  num = 1
  for i in range(n2-1,len(s)):
    if s[i] != s[len(s)-num]:
      data = False
      break
    num += 1
  return data

f = check1(s, n1)
f = check2(s, n2)
if f == True:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
N1 = int(((N-1)/2)-1)
N2 = int(((N + 3)/2)-1)
A = S[:N1+1]
B = S[N2:]
BB = B[::-1]
C = 0
n = len(A)
nn = int(n/2)
nnn = int((n-1)/2)

if A == BB:
  C += 1
  
if n%2 == 0:
  AA = A[nn + 1:]
  if A[:nn + 1] == AA[::-1]:
    C += 1
elif n%2 ==1:
  AAA = A[nnn+1:]
  if A[:nnn] == AAA[::-1]:
    C += 1
    
if C == 2:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def check(s):
  print("check:{}".format(s))
  n = len(s)
  n2 = int(n/2)
  if n < 3 or n%2 == 0:
    return False
  for i in range(0,n2):
    ni = n-i
    if s[i:i+1] != s[ni-1:ni]:
      return False
  return True

s = input('')
if check(s):
  # 1文字目～(N-1)/2文字目が回文か、判定 
  n2 = int((len(s)-1)/2)
  s2 = s[0:n2]
  print("n:{} s:{}".format(n2,s2))
  if check(s2):
    # (N+3)/2 文字目までの回文判定
    n3 = int((len(s)+3)/2)
    s3 = s[n3-1:]
    print("n:{} s:{}".format(n3,s3))
    if check(s3):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def check(s: str, n: int):
    return s[:(n-1)//2] == s[(n+1)//2:][::-1]


s = input()
n = len(s)

if check(s, n) and check(s[:(n-1)//2], (n-1)//2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
str_num = -1
reverse_S = ''

#条件1（Sが回文であるか）
for i in range(-1,-(N+1),-1):
  reverse_S = reverse_S + S[i]

if S == reverse_S:
  condition1 = 'YES'
else:
  condition1 = 'NO'

#条件2
S2 = ''
N2 = int((N-1)/2)
for i in range(N2):
  S2 = S2 + S[i]
  
reverse_S2 = ''
for i in range(-1,-(N2+1),-1):
  reverse_S2 = reverse_S2 + S2[i]

if S2 == reverse_S2:
  condition2 = 'YES'
else:
  condition2 = 'NO'
  
#条件3
S3 = ''
N3 = int((N+3)/2)
for i in range(N3-1,N):
  S3 = S3 + S[i]
  
  
reverse_S3 = ''
for i in range(-1,-(N3-1),-1):
  reverse_S3 = reverse_S3 + S3[i]
  
if S3 == reverse_S3:
  condition3 = 'YES'
else:
  condition3 = 'NO'

if condition1 == condition2 == condition3:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
l = len(S)
import sys
a = S[:(l-1)//2]
b = S[(l+3)//2:l]

for i in range(len(a)//2):
    if str(a[i])==str(a[-i]):
        pass
    else:
        print('No')
        sys.exit(0)


for j in range(len(b)//2):
    if b[j]==b[-j]:
        pass
    else:
        print('No')
        sys.exit(0)


for k in range(l//2):
    if S[k] == S[-k-1]:
        pass
    else:
        print('No')
        sys.exit(0)

print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
def check(i):
    i2 = i[len(i) // 2 + 1:]
    if i[0:len(i) // 2] == i2[::-1]:
        return(True)
    return(False)

s2 = s[0:(len(s) - 1) // 2]
s3 = s[(len(s) + 3) // 2 - 1:]

if check(s) == True and check(s2) == True and check(s3) == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
text = str(input())
n = len(text)
target = (n-1)//2
 
print(target)
 
bef = text[:target]
aft = text[target+1:]

 
if bef == aft:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
def is_palindrome(s):
    return s == s[::-1]

s_len = len(s)
if is_palindrome(s):
    if is_palindrome(s[:(s_len-1)//2]):    
        if is_palindrome(s[(s_len+3)//2-1:]):
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
def kai(s):
    if len(s)%2 == 0:
        if s[:int(len(s)/2)] == s[int(len(s)/2):]:
            return True
        else:
            return False

    else:
        if s[:int((len(s)-1)/2)] == s[int((len(s)+1)/2):]:
            return True
        else:
            return False

S1 = S[:int((len(S)-1)/2)]
S2 = S[int((len(S)+1)/2):]
if kai(S) & kai(S1) & kai(S2):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

def reverse(s): 
    return s[::-1] 
  
def isPalindrome(s): 
    
    rev = reverse(s) 
  
    if (s == rev): 
        return True
    return False
def listToString(s):  

    str1 = ""  
    for ele in s:  
        str1 += ele   
   
    return str1   
    
s=input()
n = len(s)
p=int(round((n-1)/2))
q=int(round((n+3)/2))
ans = isPalindrome(s)
print(ans)

t1=[]
t2=[]

for i in range(0,p):
    t1.append(s[i])
for i in range(q-1,n):
    t2.append(s[i])    
print(t1,t2)
ans1=isPalindrome(listToString(t1))
ans2=isPalindrome(listToString(t2))
if (ans==1 and ans1==1 and ans2==1):
    print ("Yes")
    
else:
    print("No")

Submission status: Wrong Answer

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

def sc(s):
  l = len(s)
  if l == 2:
    r = s[0] == s[1]
  elif l == 3:
    r = s[0] == s[2]    
  elif s[0] == s[l-1]:
    r = sc(s[1:l-1])
  else:
    r = False
  return r

s = input()
l1 = int((len(s)-1)/2)
l2 = int((len(s)+3)/2) - 1
if (sc(s) and sc(s[:l1]) and sc(s[l2:])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()

def solve(str): return 1 if str == str[::-1] else 0

if solve(S) and solve(S[:round((len(S) - 1) / 2)]) and solve(S[round((len(S) + 3) / 2 + 1):]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()

def kai(s):
    if len(s)%2 == 0:
        if s[:int(len(s)/2)] == s[int(len(s)/2):]:
            return True
        else:
            return False

    else:
        if s[:int((len(s)-1)/2)] == s[int((len(s)+1)/2):]:
            return True
        else:
            return False

if kai(s) and kai(s[:int((len(s)-1)/2)]) and kai(s[int((len(s)+1)/2):]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

x = int((N-1)/2)
y = int((N+3)/2)

a = str(S[:x])
b = str(S[y:N])

if str(a) == str(reversed(a)) and str(b) == str(reversed(b)):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = str(input())
N = len(S)
 
small = round((N-1)/2)
big = round((N+3)/2)-1

smallS = S[:small]
bigS = ''.join(list(reversed(S[big:])))

"""kaibunA = S[:round(N/2)-1]
kaibunB = ''.join(list(reversed(S[round(N/2):])))"""

if N > 5:
#	if kaibunA == kaibunB:
		if smallS == bigS:
			print('Yes')
		else:
			print('No')
#	else:
#		print('No')
else:
    print('No')

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:(N-1)//2]
S2=S[-1+(N+3)//2:N]
if ispalindrome(S) and ispalindrome(S1) and ispalindrome(S2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
c=0
n=len(s)
for i in range(int((n-1)/2)):
    if s[i]!=s[n-i-1]:
        c=c+1
        break
e=int(n/2)
d=int((n-1)/4)
for i in range(d):
    if s[i]!=s[e-i-1]:
        c=c+1
        break
d=int((n+3)/2)

for i in range(d,n):
    if s[i]!=s[n-i-1]:
        c=c+1
        break
if(c>0):
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
def check1(z):
    for i in range(len(s[:z])):
        if s[i] == s[z - 1 - i]:
            continue
        else:
            return False
    return True

def check2(z):
    count = 1
    for i in range(z, len(s)):
        if s[i-1] == s[len(s)-count]:
            count += 1
        else:
            return False
    return True

s = input()
N = len(s)
    
a = int((N - 1) / 2)
b = int((N + 3) / 2)
flag1 = check1(a)
flag2 = check2(b)
if flag1 == True and flag2 == True:
    print("Yes")
else:
    print("No")

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:(N-1)//2]
S2=S[-1+(N+3)//2:N]
print(S1)
print(S2)
if ispalindrome(S) and ispalindrome(S1) and ispalindrome(S2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
num = ((len(s)+1)//2)-1
n = ((len(s)+3)//2)-1
str = s[:num]
str2 = s[n:]
if str2 == str2[::-1]:
    if str == str[::-1]:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

Solution code:
ans = "Yes"
s = input()
if s != s[::-1]: # スライスというやつ
  ans = "No"
n = len(s) // 2
if s[:n] != s[0:n:-1]:
  ans = "No"
print(ans)

Submission status: Wrong Answer

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

Sa=S[:(L-1)//2]
Sb=S[(L+3)//2-1:(L+1)]
La=len(Sa)
Lb=len(Sb)

for j in range(La//2):
	print(Sa[j],Sa[-j-1])
	if Sa[j] == Sa[-j-1]:
		count+=1
	else:
		print("No")
		exit()
        
for k in range(Lb//2):
	if Sb[k] == Sb[-k-1]:
		count+=1
	else:
		print("No")
		exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
S=input()
l=len(S)
num=int((l-1)/2)

x=True
for i in range(num):
    if not S[i]==S[(num-i-1)]:
        x=False
   

for i in range(num+1,l):
    if not S[i]==S[(l+num-i)]:
        x=False
        
if x==True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=str(input())
import sys
t=0
lista=[]
for i in range(99):
  try:
    lista.append(S[i])
    t=t+1
  except IndexError:
    break
u=t//2
v=u//2+1
p=1
for i in range(v):
  if S[i]==S[u-i-1]:
    p=p*1
  else:
    print ('No')
    sys.exit()
for j in range(v):
  if S[u+j+1]==S[t-1-j]:
    p=p*1
  else:
    print ('No')
    sys.exit()

print ('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

def solve(str): return 1 if str == str[::-1] else 0

if solve(S) and solve(S[:int((len(S) - 1) / 2)]) and solve(S[int((len(S) + 3) / 2 + 1):]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
raw_input = input()
S_list = list(raw_input)
N = len(S_list)

def judge_par(s_list,n):
    print(s_list)
    if n % 2 ==0:
        n_half = n // 2
        s_top = s_list[:n_half]
        s_bottom = s_list[n_half:]
        s_bottom.reverse()
    else:
        n_half = (n-1) // 2
        s_top = s_list[:n_half]
        s_bottom = s_list[(n_half+1):]
        s_bottom.reverse()
    print(s_top)
    print(s_bottom)
    if s_top == s_bottom:
        return True
    else:
        return False
    
if judge_par(S_list,N) == True:
    N_half = (N-1) // 2
    S_top = S_list[:N_half]
    S_bottom = S_list[(N_half+1):]
    if judge_par(S_top,N_half) == True and judge_par(S_bottom,N_half) == True:
        print ("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
f=0
for i in range((N-1)//4):
    if S[i]!=S[(N-3)//2-i]:
        f=-1
        #print(i)
        break
for i in range((N+1)//2,(3*N+1)//4):
    if S[i]!=S[N-1-i]:
        f=-1
        #print(i)
        break
if f==-1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True
s = str(input())
if is_kaibun(s)==True:
    ku = int((len(s)-1)/2)
    news = s[:ku]
    if len(news) ==1:
        print("Yes") 
    else:
        a = 0
        for a in range(len(news)//2):
            if news[a] != news[-a-1]:
                print("No")
            else:
                ks = int((len(s)+1)/2)
                news = s[ks:]
                b = 0
                for b in range(len(news)//2):
                    if news[b] != news[-b-1]:
                        print("No")
                    else:
                        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def ispalindrome(S,N):
    for a, b in zip(S[:N], reversed(S[N+1:])):
        if a != b: return 0
    return 1

def ispalindrome2(S,N):
    for a, b in zip(S[N2:N], reversed(S[N+1:N2])):
        if a != b: return 0
    return 1

S = input()
N = len(S)
N1 = (N-1)//2
N2 = (N+3)//2

r1 = ispalindrome(S,N)
r2 = ispalindrome(S,N1)
r3 = ispalindrome2(S,N2)
if r1==1 and r2==1 and r3==1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
flag=0
for i in range((N-1)//4):
	if S[i]!=S[(N-1)//2 -i-1]:
		flag=1
		break
	if S[(N+3)//2 +i-1]!=S[N-1-i]:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
list_a = []
count = 0

for i in range(0, N):
    list_a.append(S[i])

for i in range(0, N):
    if list_a[i] == list_a[N-1-i]:
        pass
    else:
        count += 1


for j in range(0, int(N//2)):
    if list_a[i] == list_a[int((N-3-i)/2)]:
        pass
    else:
        count += 1


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

Submission status: Wrong Answer

Solution code:
s = input()
def check(i):
    if i[0:len(i) // 2] == (i[len(i) // 2 + 1:])[::-1]:
        return(True)
    return(False)

s2 = s[0:(len(s) - 1) // 2]
s3 = s[(len(s) + 3) // 2 - 1:]

if check(s) == True and check(s2) == True and check(s3) == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
count=0
a=(n-1)//2
b=(n+3)//2
for i in range(n//2):
  if s[i]!=s[-abs(i+1)]:
    count+=1
    
for i in range(a//2):
  c=ord(s[i])
  d=ord(s[(a-1-i)])
  if c!=d:
    count+=1

for i in range((n-b+1)//2):
  c=ord(s[-(i+1)])
  d=ord(s[b-1-i])
  if c!=d:
    count+=1

if count!=0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
num = (len(s)+1)//2-1
n = (len(s)+3)//2-1
str = s[:num]
str2 = s[n:]
if str2 == str2[::-1]:
    if str == str[::-1]:
        print("Yes")
        exit()
print("No")

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)
c = a[::-1]
d = b[::-1]
#print(a, b)

if N2 % 2 == 0:
    # print(a[0:N2 // 2])
    # print(c[0:N2 // 2])
    # print(b[0:N2 // 2])
    # print(d[0:N2 // 2])
    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:
    # print(a[0:(N2 + 1) // 2])
    # print(c[0:(N2 + 1) // 2])
    # print(b[0:(N2 + 1) // 2])
    # print(d[0:(N2 + 1) // 2])
    if a[0:(N2+1)//2] == c[0:(N2+1)//2] and b[0:(N2+1)//2] == d[0:(N2+1)//2]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
a=s[:int((n-1)/2)]
b=s[int((n+3)/2)-1:]
bb=b[::-1]
m=len(a)
c=a[:int((m-1)/2)]
d=b[int((m+3)/2)-1:]
dd=d[::-1]

if a==bb:
    if c==dd:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#coding:utf-8
s = input()
n = len(s)
half = (n-1)//2
half_1 = half // 2
m = n - (n+3)//2
l = (n+3)//2 -1
half_2 = m // 2

#sが回文か
if s[:half] == s[-1:half:-1]:
    #print(s[:half], s[-1:half:-1])
    print('Yes')
    exit()

elif half % 2 != 0 and s[:half_1] == s[half-1:half_1:-1]:
    #print(half_1)
    #print(s[:half_1], s[half-1:half_1:-1])
    print('Yes')
    exit()

elif half % 2 == 0 and s[:half_1] == s[half:half_1:-1]:
    print('Yes')
    exit()

elif (m-1) % 2 != 0 and s[l:l+half_2] == s[-1:l+half_2+1:-1]:
    #print(l+half_2)
    #print(s[l:l+half_2], s[l+half_2+1:])
    print('Yes')
    exit()

elif (m-1) % 2 == 0 and s[l:l+half_2] == s[-1:l+half_2:-1]:
    print('Yes')
    exit()


print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
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(s):
    if n % 2 == 0:
        print("No")
    elif isPalindrome(s1) and isPalindrome(s2):
        print("Yes")
    else:
        print("No")
else:
    print("o")

Submission status: Wrong Answer

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

out = "Yes"
for i in range(int((N-1)/4)):
    #print(S[int((N-1)/2)-i-1])
    #print(S[int((N+3)/2)-i-1])
    if S[i] == S[int((N-1)/2)-i-1]:
        pass
    elif S[i] != S[int((N-1)/2)-i-1]:
        out = "No"
        break
    elif S[int((N+3)/2)-i-1] == S[-i]:
        pass
    else:
        out = "No"
        break
print(out)

Submission status: Wrong Answer

Solution code:
from collections import deque
S = input()
N = len(S) 
s1 = deque(S[0:int((N-1)/2)])
s2 = deque(S[int((N+3)/2)-1:N])
t1 = deque(S[0:int((N-1)/2)])
t2 = deque(S[int((N+3)/2)-1:N])
ans = "None"
while len(s1) >= 2:
    if s1.popleft() != s2.pop():
        ans = "No"
        break
    if len(s1) == 1 or len(s1) == 0:
        ans = "preYes"
        break

if ans == "preYes":
    while len(t1) >= 2:
        if t1.pop() != t1.popleft():
            ans = "No"
            break
        if len(t1) == 1 or len(t1) == 0:
            ans = "Yes"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
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(s):
    if n % 2 == 0:
        print("No")
    elif isPalindrome(s1) and isPalindrome(s2):
        print("Yes")
    else:
        print("No")
else:
    print("")

Submission status: Wrong Answer

Solution code:
str = input()
N = len(str)
flag = 1

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

else:
    for i in range((N-1)//4):
        if(str[i] != str[(N-1)//2-1-i]):
            flag = 0
            break
    

    for i in range((N+3)//2-1,(N+3)//2-1 + (N-(N+3)//2+1)//2):
        if(str[i] != str[N-1 + ((N+3)//2-1) - i]):
            flag = 0
            break

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

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)
l = int((n-1)/2)
b = int((n+3)/2)

for i in range(l - int(l/2)):
    print(s[i])
    print(s[l-1-i])
    if not s[i] == s[l-1-i]:
        print('No')
        exit()

for i in range(n-b - int((n-b)/2)):
    print(s[b-1+i])
    print(s[n-1-i])
    if not s[b-1+i] == s[n-1-i]:
        print('No')
        exit()

for i in range(int(n/2)):
    if not s[i] == s[n-1-i]:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
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(s):
    if n % 2 == 0:
        print("No")
    elif isPalindrome(s1) and isPalindrome(s2):
        print("Yes")
    else:
        print("No")
else:
    print("u")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
n = N+1
count = 0
if N>5:
  for i in range(0,int(n/4)-1):
    if ((S[i] == S[int(n/2) - 2 - i])& (S[int(n/2)] == S[N-1-i])):
        pass
    else:
        count +=1
elif N == 5:
  if ((S[0] == S[1]) & (S[3]== S[4])):
    pass
  else:
    count += 1
elif N ==3:
  if (S[0] == S[2]):
    pass
  else:
    count +=1


if count ==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict, deque
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def IS(): return input().rstrip()

def main():
    S = IS()
    N = len(S)
    if N%2 == 1:
        a = N//2
        if S[:a] == S[a+1:][::-1]:
            b = int((N-1)/2/2)
            
            if S[:b] == S[b+1:a][::-1]:
                c = (N+3)//2; d = c+(N-c)//2
                #print((S[c-1:d-1], S[d:][::-1]))
                if S[c-1:d-1] == S[d:][::-1]:
                    print('Yes')
                    sys.exit()
    print('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
def check(i):
    if i[0:len(i) // 2] == (i[len(i) // 2 + 1:])[::-1]:
        return(True)
    return(False)

s2 = s[0:len(s) // 2]
s3 = s[(len(s) + 3) // 2 - 1:]

if check(s) == True and check(s2) == True and check(s3) == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
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(s):
    if n % 2 == 0:
        print("No")
    elif isPalindrome(s1) and isPalindrome(s2):
        print("Yes")
    else:
        print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input().strip()
n = len(s)

def is_kaibun(s):
    n = len(s)
    head = s[:(n - 1) // 2]
    tail = s[(n + 3) // 2-1:]
    # print("head = {} tail = {}".format(head, tail[::-1]))
    return head == tail[::-1]

if is_kaibun(s) and is_kaibun(s[:(n-1)//2]) and is_kaibun(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
print((s==s[::-1]) and (s[(n-1)//2+1:]==s[:(n-1)//2:-1]))

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
count=0
a=(n-1)//2
b=(n+3)//2
for i in range(n//2):
  if s[i]!=s[-abs(i+1)]:
    count+=1
    
for i in range(1):
  c=ord(s[i])
  d=ord(s[(a-1-i)])
  if c!=d:
    count+=1

for i in range((n-b+1)//2):
  c=ord(s[-(i+1)])
  d=ord(s[b-1-i])
  if c!=d:
    count+=1

if count!=0:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
n = len(s)
N = int((n-1)/2)
M = int((n+3)/2)
l = []
m = []
for i in range(N):
    l.append(s[i])
for i in range (M-1,N):
    m.append(s[i])
a = ''.join(l)
b = ''.join(m)
l.reverse()
m.reverse()
A = ''.join(l)
B = ''.join(m)
if (a==A and b==B and a == b):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
a=s[:int((n-1)/2)]
b=s[int((n+3)/2)-1:]
b=b[::-1]
m=len(a)
c=a[:int((m-1)/2)]
d=b[int((m+3)/2)-1:]
d=d[::-1]

if a==b:
    if c==d:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10 ** 6)


def main():
	s = sys.stdin.readline().rstrip()
	n = len(s)
	front = s[:(n-1)//2]
	end = s[(n+3)//2-1:]
	if len(front) % 2 == 0:
		ff = front[:len(front)//2]
		fe = front[len(front)//2:]
	else:
		ff = front[:len(front)//2]
		fe = front[len(front)//2+1:]
	if len(end) % 2 == 0:
		ef = end[:len(end)//2]
		ee = end[len(end)//2:]
	else:
		ef = end[:len(end)//2]
		ee = end[len(end)//2+1:]
	if front == end and ff == fe and ef == ee:
		print("Yes")
	else:
		print("No")

main()

Submission status: Wrong Answer

Solution code:
S = list(str(input()))

req1 = int((len(S) - 1) / 2) + 1
req2 = int((len(S) + 3) / 2) - 2
if S == list(reversed(S)) and S[req1:] == list(reversed(S[req1:])) and S[req2:] == list(reversed(S[req2:])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=input()
n=len(S)
if n==3 and S[0]==S[2]:
  print('Yes')
elif n%4==3 and S[:(n-1)//2]==S[(n-1)//2+1:] and S[:(n-3)//4]== ''.join(list(reversed(S[(n-3)//4+1:(n-1)//2]))) and S[(n-1)//2+1:-((n-3)//4+1)]==''.join(list(reversed(S[-(n-3)//4:]))):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from collections import deque

def reverse(p):
    q = p[::-1]
    if p == q:
        return True
    else:
        return False


S = input()

N = len(S)

pt1 = (N - 1) // 2 - 1
pt2 = (N + 3) // 2 - 1

ptS1 = S[:pt1 + 1]
ptS2 = S[pt2:]

#print(ptS1, ptS2)

#print(reverse(ptS1), reverse(ptS2))

if reverse(ptS1) and reverse(ptS2):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

def reverse(s): 
    return s[::-1] 
  
def isPalindrome(s): 
    
    rev = reverse(s) 
  
    if (s == rev): 
        return True
    return False
    
s=input()
n = len(s)
p=int(round((n-1)/2))
q=int(round((n+3)/2))
ans = isPalindrome(s)  
t1=[]
t2=[]
ans1=isPalindrome(t1)
ans2=isPalindrome(t2)
for i in range(0,p):
    t1.append(s[i])
for i in range(q-1,n):
    t2.append(s[i])    


if (ans==1 and ans1==1 and ans2==1):
    print ("Yes")
    
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

def solve(str): return 1 if str == str[::-1] else 0


if solve(S) and solve(S[:(len(S) - 1) // 2]) and solve(S[(len(S) + 3) // 2 + 1:]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
t = s
t.reverse()
x = ''.join(s)
y = ''.join(t)
n = len(s)
N = int((n-1)/2)
M = int((n+3)/2)
l = []
m = []
for i in range(N):
    l.append(s[i])
for i in range (M-1,N):
    m.append(s[i])
a = ''.join(l)
b = ''.join(m)
l.reverse()
m.reverse()
A = ''.join(l)
B = ''.join(m)
if (a==A and b==B and x == y):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

s = input()
n = len(s)

flag = True
# 回分チェック
if not s[:int(n/2)] == s[int(n/2)+1:]:
    flag = False

# 2チェック
chk = s[:int((n-1)/2)]
len_ = len(chk)
if not len_ % 2 == 0:
    a = chk[:int(len_/2)]
    b = chk[int(len_/2)+1:]
else:
    a = chk[:int(len_/2)]
    b = chk[int(len_/2):]
len_ = len(chk)
if not a == b:
    flag = False
# 3チェック
chk = s[int((n+3)/2)-1:]
len_ = len(chk)
if not len_ % 2 == 0:
    a = chk[:int(len_/2)]
    b = chk[int(len_/2)+1:]
else:
    a = chk[:int(len_/2)]
    b = chk[int(len_/2):]
len_ = len(chk)
if not a == b:
    flag = False
if flag:
    print('Yes')
else:
    print('No')

#kkkkkkkkkkdkkkkkkkkkk
#21
#abcdeefghiAihgfeedcba

Submission status: Wrong Answer

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

s_list = list(s)
r_list = list(s)
r_list.reverse()

first_s_list = s_list[0:(n - 1) // 2]
first_r_list = list(reversed(first_s_list))

last_s_list = s_list[(n - 1) // 2 + 1:n]
last_r_list = list(reversed(last_s_list))

if s_list == r_list and first_s_list == first_r_list and last_s_list == last_r_list:
    print('Yes')
else:
    print('No')

print(s, n)
print(first_s_list, first_r_list)
print(last_s_list, last_r_list)

Submission status: Wrong Answer

Solution code:
a = input()
n= len(a)
zenzen = a[0:n//2//2]
zenkou = a[n//2//2:n//2]
kouzen = a[n//2+1:n-1-n//2//2]
koukou = a[n-1-n//2//2]
new_zenkou = ''.join(list(reversed(zenkou)))
new_koukou = ''.join(list(reversed(koukou)))
if zenzen != new_zenkou:
  print('No')
  exit()
if kouzen != new_zenkou:
  print('No')
  exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import copy

S = input()
flag_fail = 0
N = len(S)

while N != 1:
  S_temp = copy.copy(S)
  N = len(S)
  K = N // 2
  if N == 2:
    break
  else:
    for i in range(K):
      if S_temp[i] != S_temp[N - i - 1]:
        flag_fail = 3
        break
        
  if flag_fail != 0:
    print('No')
    break
  else:
    S = []
    S = S_temp[0:K]
if flag_fail == 0:
  print('Yes')

Submission status: Wrong Answer

Solution code:
ans = "Yes"
s = input()
if s != s[::-1]: # スライスというやつ
  ans = "No"
n = len(s) // 2
if s[:n] != s[:n:-1]:
  ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
def is_kaibunn(str): return 1 if str == str[::-1] else 0
word_front = input()
flag = 0
num = len(word_front)
word_back = word_front
while num > 1:
    if is_kaibunn(word_front) and is_kaibunn(word_back):
        flag = 1
    else:
        flag = 0
        break;
    if num%2 == 1:
        num_flag = 1
    else:
        num_flag = 0
    num = int(num/2)
    if num_flag == 1:
        word_front = word_front[0:num]
        word_back = word_back[num+1:]
    else:
        word_front = word_front[0:num]
        word_back = word_back[num:]       
if flag:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s1 = s[:(n - 1)//2]
s2 = s[(n + 3)//2 - 1:]
if s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def kaibun(sl):
    for i in range(len(sl)):
        if sl[i] != sl[-1-i]:
            return 'No'
        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)+1):
    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()

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

if solve(S) and solve(S[:(len(S) - 1) // 2]) and solve(S[(len(S) + 3) // 2 + 1:]):
    print("Yes")
else:
    print("No")