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()
s_rev = s[::-1]
n = len(s)
if n < 3:
    print('No')
##1つ目の条件
else:
    n1 = int((n-1)/2)
    s1 = s[0:n1]
    s_rev = s1[::-1]
    ##2つめの条件
    n2 = int((n+3)/2)
    s2 = s[n2-1:n]
    s2_rev = s2[::-1]
    ##判定
    if s1 == s_rev and s2 == s2_rev and s == s_rev:
        print('Yes') 
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
s = input()
flg = 0
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s[(n+3)//2-1:]
#print(s1,s2,len(s1)//2-1)
for i in range(len(s1)//2):
#  print(s1[i-1], s1[-i], s2[i-1], s2[-i])
  if s1[i] != s1[-i-1]:
    flg = 1
    break
  if s2[i] != s2[-i-1]:
    flg = 1
    break 

print("Yes" if flg == 0 else "No")

Submission status: Wrong Answer

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


s1 = s[0:int((n-1)/2)]
s1 = s1[::-1]

s2 = s[0:int(((n-1)/2 - 1)/2)]
s2 = s2[::-1]

s3 = s[int((n+3)/2 -1):int((n + ((n+3)/2) -1) / 2)]
s3 = s3[::-1]

if (s[int((n+3)/2 - 1):n]==s1) and (s[int(((n-1)/2 + 1)/2):int((n-1)/2)] == s2) and (s[int((n + ((n+3)/2) +1) / 2):n] == s3):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
j1 = S[:int((N+1)/2-1)] == S[int((N+1)/2):]

j2_str = S[0:int((N+1)/2-1)]
l2 = len(j2_str)
if l2%2==0:
    j2 = j2_str[:int((l2)/2-1)] == j2_str[int((l2)/2):]
else :
    j2 = j2_str[:int((l2-1)/2)] == j2_str[int((l2-1)/2+1):]

j3_str = S[int((N+3)/2-1):]
l3 = len(j3_str)
if l3%2==0:
    j3 = j3_str[:int((l3)/2-1)] == j3_str[int((l3)/2):]
else :
    j3 = j3_str[:int((l3-1)/2)] == j3_str[int((l3-1)/2+1):]

if N>=7:
    if j1&j2&j3:
        ans = 'Yes'
    else :
        ans = 'No'
elif N==5:
    if S[0]==S[1]==S[3]==S[4]:
        ans='Yes'
    else :
        ans='No'
else :
    if S[0]==S[2]:
        ans = 'Yes'
    else :
        ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
letter=input()
def isKaibun(s):
  res = True
  for i in range(int((len(s))/2)):
    if s[i] != s[-1-i]:
      res = False
      break
  return res
if isKaibun(letter[0:int((len(letter)-1)/2)]):
  if isKaibun(letter[int((len(letter)+3)/2-1):]):
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
s = list(S)
s_len = len(s)
s_1 = s_len-1
t = int(s_1/2)
x = 0
y = 0
z = 0

for i in range(0,t):
    if s[i] == s[s_1-i]:
        x += 1
if x == t and t%2 == 1:
    k = int((t-1)/2)
    for i in range(0,k):
        if s[i] == s[t-i-1]:
            y += 1
        if s[t+1+i] == s[s_1-i]:
            z += 1
        if y == k and z == k:
            print('Yes')
        else:
            print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
if n==3:
    if s[0] == s[2]:
        print("Yes")
    else:
        print("No")
    exit()
ls = []
l1 = (n-1)//2
l2 = l1+2
h = l1//2
f = True
for i in range(h):
    if s[i] == s[l1-i-1]:
        pass
    else:
        f = False
    if s[-i-1] == s[l2+i-1]:
        pass
    else:
        f = False
    if s[i] != s[-i-1]:
         f = False
    if s[l1-i-1] !=s[l2+i-1]:
        f = False
if n%4 ==3:
    if s[(n+1)//4] != s[n-1-(n+1)//4]:
        f = False
if f:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
if S == S[::-1] and S[0:(N-3)//2] == S[0:(N-3)//2:-1] and S[(N+1)//2:N-1] == S[(N+1)//2:N-1:-1]:
    print ('Yes')
else:
    print ('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
str = input()
list_str = list(str)

pal = "Yes"

for i in range(len(list_str) // 2):
  if list_str[i] != list_str[len(list_str) - 1 - i]:
    pal = "No"
    break

str_half = []

for i in range((len(list_str) // 2)):
  str_half.append(list_str[i])
  
if len(str_half) <= 1:
  pal = "No"
else:
  for i in range(len(str_half) // 2):
    if str_half[i] != list_str[len(str_half) - 1 - i]:
      pal = "No"
      break

str_any = []

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

if len(str_any) <= 1:
  pal = "No"
else:
  for i in range(len(str_any) // 2):
    if str_any[i] != list_str[len(str_any) - 1 - i]:
      pal = "No"
      break

print(pal)

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

be = []
af = []

for i in range(N//2):
    be.append(S[i])
    af.append(S[i+N//2+1])
    
re_be = list(reversed(be))
re_af = list(reversed(af))

count = 0
    
for i in range(N//2):
    if be[i] == re_be[i] and af[i] == re_af[i]:
        count+=1
        
if count == N//2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
#input = sys.stdin.readline
#文字列のときはうまく行かないのでコメントアウトすること
sys.setrecursionlimit(2147483647)

def main():
  s = input()
  tf = 'True'
  n = len(s)
  for i in range(n//2):
    if s[i]!=s[(n-1)-i]:
      tf = 'False'
      
  for i in range(int((n-1)/2)):
    if s[i]!=s[int((n-1)/2-1-i)]:
      tf = 'False'
    
  for i in range(int((n-3)/2)):
    print(s[int((n+3)/2-1+i)])
    print(s[n-1-i])
    if s[int((n+3)/2-1+i)]!=s[n-1-i]:
      tf = 'False'
      
  if tf=='True':
    print('Yes')
  else:
    print('False')
  

if __name__ == '__main__':
  main()

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]:
        count += 1
    else:
        pass

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

if count > N+1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
wholeString = input()
firstSub = wholeString[0:int((len(wholeString)-1)/2)]
secondSub = wholeString[int(((len(wholeString)+3)/2)-1):]
if firstSub == firstSub[::-1] and secondSub == secondSub[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=input()
n = len(s)
flg_a = 0
flg_b=0

pa = 0
pb = 0

sa = s[0:int((n-1)/2)]
for i in range(int(((n-1)/2)//2)):
    if sa[i]==sa[-(i+1)]:
        pa += 1
if pa==((n-1)/2)//2:
    flg_a +=1

sb = s[int((n+3)/2)-1:n]
for j in range(int((n-(n+3)/2+1)//2)):
    if sb[j]==sb[-(j+1)]:
        pb +=1
if pb==(n-(n+3)/2+1)//2:
    flg_b +=1

if flg_a+flg_b==2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
seq = input()
if seq[:int((len(seq) - 1) / 2)] == seq[:int((len(seq) - 1) / 2)][::-1]:
    print()
    if seq[int((len(seq) + 3) / 2) - 1:] == seq[int((len(seq) + 3) / 2) - 1:][::-1]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
S_1 = S[0:(N-1)//2]
S_2 = S[(N+3)//2-1:N]
S_1_reverse = S_1[::-1]
S_2_reverse = S_2[::-1]
if S_1 == S_1_reverse:
  if S_2 == S_2_reverse:
    print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

if (not S.islower()):
    sys.exit()
if (N < 3 or N > 99):
    sys.exit()
if (N%2 == 0):
    sys.exit()

av  = (N-1)/2
av  = int(av)
av2 = (N+3)/2
av2 = int(av2)

pal = S[0:av]
pal2 = S[av2-1:N]

if (pal == pal[::-1]):
    if (pal2 == pal2[::-1]):
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
flg = 0
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s[(n+3)//2-1:]
#print(s1,s2,len(s1)//2-1)
for i in range(1,len(s1)//2-1):
#  print(s1[i-1], s1[-i], s2[i-1], s2[-i])
  if s1[i-1] != s1[-i]:
    flg = 1
    break
  if s2[i-1] != s2[-i]:
    flg = 1
    break 

print("Yes" if flg == 0 else "No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if n < 3:
    print('No')
##1つ目の条件
else:
    n1 = int((n-1)/2)
    s1 = s[0:n1]
    s_rev = s1[::-1]
    ##2つめの条件
    n2 = int((n+3)/2)
    s2 = s[n2-1:n]
    s2_rev = s2[::-1]
    ##判定
    if s1 == s_rev and s2 == s2_rev:
        print('Yes') 
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
S=input()
sum="Yes"
kai=len(S)
unk=(int(kai)-1)/2
unk1=(int(kai)+3)/2
A=S[0:int(unk)]
B=S[int(unk1):int(kai)]
for i in range(kai//2):
  if S[i]!=S[-i-1]:
    sum="No"
for i in range(len(A)):
  if A[i]!=A[-i-1]:
    sum="No"
for i in range(len(B)):
  if B[i]!=B[-i-1]:
    sum="No"
print(sum)

Submission status: Wrong Answer

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

s2 = s[0:(len(s) - 1) // 2]
s3 = s[(len(s) - 1) // 2 + 1:len(s)]
#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()
flg = 0
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s[(n+3)//2-1:]
print(s1,s2,len(s1)//2-1)
for i in range(1,len(s1)//2-1):
  print(s1[i-1], s1[-i], s2[i-1], s2[-i])
  if s1[i-1] != s1[-i]:
    flg = 1
    break
  if s2[i-1] != s2[-i]:
    flg = 1
    break 

print("Yes" if flg == 0 else "No")

Submission status: Wrong Answer

Solution code:

def main():
    char_s = input()

    char_len = len(char_s)
    char_first = char_s[0:int((char_len-1)/2)]
    char_second = char_s[int((char_len+3)/2-1):char_len]

    flg_a = is_kaibun(char_first)
    flg_b = is_kaibun(char_second)

    if (flg_a==1) & (flg_b==1):
        print('Yes')
    else:
        print('No')

def is_kaibun(str):

    strlen = len(str)
    for k in range(int(strlen/2)):
        if str[k] == str[strlen-k-1]:
            continue
        else:
            return 0

    return 1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if (not S.islower()):
    sys.exit()
if (N < 3 or N > 99):
    sys.exit()
if (N%2 == 0):
    sys.exit()

av  = (N-1)/2
av  = int(av)
av2 = (N+3)/2
av2 = int(av2)

pal = S[0:av]
pal2 = S[av2:N]

if (pal == pal[::-1]):
    if (pal2 == pal2[::-1]):
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if n < 4:
    print('No')
##1つ目の条件
else:
    n1 = int((n-1)/2)
    s1 = s[0:n1]
    s_rev = s1[::-1]
    ##2つめの条件
    n2 = int((n+3)/2)
    s2 = s[n2-1:n]
    s2_rev = s2[::-1]
    ##判定
    if s1 == s_rev and s2 == s2_rev:
        print('Yes') 
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
#文字列の入力
S = input()
#listを一文字ずつのlistに
S_list = list(S)

counter = 0
counter_ = 0
counter__ = 0


for i in range(int(len(S_list)/2)):
    if(S_list[i]==S_list[i+int(len(S_list)/2)+1]):
        counter = counter + 1
    else:
        counter = counter
if(counter != int(len(S_list)/2)):
    print("No")
    
    
else:
    for i in range(int(len(S_list)/4)):
        if(S_list[i]==S_list[i+int(len(S_list)/4)+1]):
            counter_ = counter_ + 1
        else:
            counter_ = counter_
    if(counter_ != int(len(S_list)/4)):
        print("No")
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
ans="Yes"
if n==3:
  if s[0]!=s[2]:
    ans="No"
if n%4==1:
  for i in range((n-1)//4):
    if s[i]!=s[((n-1)//2)-1+i]:
      ans="No"
    if s[((n+3)//2)-1+i]!=s[n-1-i]:
      ans="No"
if n%4==3:
  for j in range((n-3)//4):
    if s[j]!=s[((n-1)//2)-1+j]:
      ans="No"
    if s[((n+3)//2)-1+j]!=s[n-1-j]:
      ans="No"
print(ans)

Submission status: Wrong Answer

Solution code:
def palindrome(string): return 1 if string==string[::-1] else 0

kaibun=input()

N=len(kaibun)
A=kaibun[0:int((N-1)/2)]
B=kaibun[int((N+3)/2-1):int(N)]


if palindrome(A) & palindrome(B):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

s = input()

if kaibun(s):
    half = int(len(s) /2)
    if half%2 == 0:
        print('No')
    else:
        s = s[:half]
        if kaibun(s):
            print('Yes')
        else:
            print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s1=input()
s=s1.split()
l=len(s1)
h=(l-1)//2
k1=s1[:h]
k2=s1[h+1:]
if k1==k2:
    a=(l-1)//2
    s3=s1[:a]
    h2=(a-1)//2
    j1=s3[:h2]
    j2=s3[h2+1:]
    if j1==j2:
        b=(l+3)//2
        b2=l-b+1
        s4=s1[:b2]
        h3=(b2-1)//2
        f1=s3[:h3]
        f2=s3[h3+1:]
        if f1==f2:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def jds(strin):
    js = 0
    nn = len(strin)
    for kk in range(int(nn / 2)):
        if strin[kk] == strin[nn - kk -1]:
            js = 1
    return js

a = input()
jud = 0

b = a[:int((len(a) - 1) / 2)]
c = a[int((len(a) +2) / 2):]

jud += jds(a) + jds(b) + jds(c)

if jud == 3:
    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])

reverse_S = ''.join(list(reversed(S)))
reverse_a = ''.join(list(reversed(a)))
reverse_b = ''.join(list(reversed(b)))

if str(S) == str(reverse_S) and str(a) == str(reverse_a) and str(b) == str(reverse_b):
  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]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int((N-1)/4)):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

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

A = int((n-1)/2-1)
B = int((n+3)/2-1)

if palindrome(s[0 : A]) and palindrome(s[B : n-1]) and s == s[::-1]:
	print("Yes")
else:
	print("No")

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)==False:
    print("No")
elif 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")
                break
        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")
                break
        print("Yes")

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()
if t>3:
  print ('Yes')
else:
  if S[0]==S[2]:
    print ('Yes')
  else:
    print ('No')

Submission status: Wrong Answer

Solution code:
# Program to check if a string is palindrome or not

S = str(input())

# make it suitable for caseless comparison
S = S.casefold()

# reverse the string
rev_str = reversed(S)

# check if the string is equal to its reverse
if list(S) == list(rev_str):
   print("Yes")
else:
   print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
n = N+1
count = 0
if N>5:
  a = S[0:int(n/2)-1]
  b = S[int(n/2):]
  p = len(a)
  q = len(b)
  if(( a == a[::-1]) & (b == b[::-1])):
    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:
#文字列の入力
S = input()
#listを一文字ずつのlistに
S_list = list(S)

counter = 0
counter_ = 0
counter__ = 0


for i in range(int(len(S_list)/2)):
    if(S_list[i]==S_list[i+int(len(S_list)/2)+1]):
        counter = counter + 1
    else:
        counter = counter
if(counter != int(len(S_list)/2)):
    print("No")
    
    
else:
    for i in range(int(len(S_list)/4)):
        if(S_list[i]==S_list[i+int(len(S_list)/4)+1]):
            counter_ = counter_ + 1
        else:
            counter_ = counter_
    if(counter_ != int(len(S_list)/4)):
        print("No")
        
        
    else:
        for i in range(int(len(S_list)/4)):
            #print(i+int(len(S_list)/2)+1,S_list[i+int(len(S_list)/2)+1],i+int(len(S_list)/2)+1+int(len(S_list)/4),S_list[i+int(len(S_list)/2)+1+int(len(S_list)/4)+1])
            if(S_list[i+int(len(S_list)/2)+1]==S_list[i+int(len(S_list)/2)+1+int(len(S_list)/4)+1]):
                counter__ = counter__ + 1
            else:
                counter__ = counter__
        if(counter__ != int(len(S_list)/4)):
            print("No")
        else:
            print("Yes")

Submission status: Wrong Answer

Solution code:
S = str(input())
N = len(S)
A = S[0:((N-1)//2)]
B = S[(N+3)//2-1:N]
if S == S[::-1] and A == A[::-1] and B == B[::-1]:
    print('Yes')
else:
    print('no')


#C

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
def ispalindrome(string): return True if string==string[::-1] else False

S1=S[0:(N-1)//2]
S2=S[-1+(N+3)//2:N]
print(ispalindrome(S1))
if ispalindrome(S) and ispalindrome(S1) and ispalindrome(S2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math
def check(s):
  #print("check:{}".format(s))
  n = len(s)
  n2 = math.ceil(n/2)
  if n == 1:
    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:
import sys

S = input()


def is_palindrome(s):
    N = len(s)
    half = N // 2
    f = s[:half]
    r = s[-half:][::-1]
    return f == r


if is_palindrome(S) and is_palindrome(S[: len(S) // 2]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()


def is_palindrome(s):
    N = len(s)
    half = N // 2
    f = s[:half]
    r = s[-half:][::-1]
    print(s, f, r)
    return f == r


if is_palindrome(S) and is_palindrome(S[: len(S) // 2]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a = str(input())
b =len(a)
c = (b-1)/2
d = (b+3)/2
A = list(a[0:int(c)])
X = list(reversed(A))
S = "".join(X)
B = list(a[int(d-1):int(b+1)])
Y = list(reversed(B))
Q = "".join(Y)
if a[0:int(c)] == S and a[int(d-1):int(b+1)] == Q:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

import sys
S = input()
N = len(S)

if (not S.islower()):
    sys.exit()
if (N < 3 or N > 99):
    sys.exit()

av  = (N-1)/2
av  = int(av)
av2 = (N+3)/2
av2 = int(av2)

pal = S[0:av]
pal2 = S[av2-1:N]

if (pal == pal[::-1]):
    if (pal2 == pal2[::-1]):
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

N_2 = (N+1) // 2 -1

if (N+1) % 4 == 0:
  N1 = N2 = (N+1) // 4 -1
  N3 = N4 = (N1+1) * 3 -1
else:
  N1 = (N-1) // 4 -1 
  N2 = N1 + 1
  N3 = N_2 + N1 +1
  N4 = N3 + 1
  
#print(N1, N2, N3, N4)
#print(S[0:N1+1], S[N2:N_2], S[N_2+1:N3+1], S[N4:N])

if S[0:N_2] == S[N_2:N][::-1] and S[0:N1+1] == S[N2:N_2][::-1] and S[N_2+1:N3+1] == S[N4:N][::-1]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def judge(S):
    #print(S)
    mid = len(S)//2
    fst = S[:mid]
    lat = S[mid+1:]
    if fst == lat[::-1]:    
        return True
    else:
        return False

S = input()
fst = (len(S)-1)//2
lat = (len(S)+3)//2

if judge(S) and judge(S[:fst]) and judge(S[lat-1:]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#文字列の入力
S = input()
#listを一文字ずつのlistに
S_list = list(S)

counter = 0
counter_ = 0
counter__ = 0


for i in range(int(len(S_list)/2)):
    if(S_list[i]==S_list[i+int(len(S_list)/2)+1]):
        counter = counter + 1
    else:
        counter = counter
if(counter != int(len(S_list)/2)):
    print("No")
    
    
else:
    for i in range(int(len(S_list)/4)):
        if(S_list[i]==S_list[i+int(len(S_list)/4)+1]):
            counter_ = counter_ + 1
        else:
            counter_ = counter_
    if(counter_ != int(len(S_list)/4)):
        print("No")
        
        
    else:
        for i in range(int(len(S_list)/4)):
            print(i+int(len(S_list)/2)+1,S_list[i+int(len(S_list)/2)+1],i+int(len(S_list)/2)+1+int(len(S_list)/4),S_list[i+int(len(S_list)/2)+1+int(len(S_list)/4)+1])
            if(S_list[i+int(len(S_list)/2)+1]==S_list[i+int(len(S_list)/2)+1+int(len(S_list)/4)+1]):
                counter__ = counter__ + 1
            else:
                counter__ = counter__
        if(counter__ != int(len(S_list)/4)):
            print("No")
        else:
            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) - 1) // 2 + 1:]
#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:
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")
                break
        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")
                break
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
if n==3:
    if s[0] == s[2]:
        print("Yes")
    else:
        print("No")
    exit()
ls = []
l1 = (n-1)//2
l2 = l1+2
h = l1//2
f = True
for i in range(h):
    if s[i] == s[l1-i-1]:
        pass
    else:
        f = False
    if s[-i-1] == s[l2+i-1]:
        pass
    else:
        f = False
    if s[i] != s[-i-1]:
         f = False
    if s[l1-i-1] !=s[l2+i-1]:
        f = False

if f:
    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])

reverse_a = ''.join(list(reversed(a)))
reverse_b = ''.join(list(reversed(b)))

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

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=input()
def kai(s):
    if len(s)%2 == 0:
        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:
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=list(input())
n=len(s)
m3=(n-1)//4
ans="Yes"
if n%4==1:
  for i in range((n-1)//4):
    if s[i]!=s[((n-1)//2)-1+i]:
      ans="No"
    if s[((n+3)//2)-1+i]!=s[n-1-i]:
      ans="No"
if n%4==3:
  for j in range((n-3)//4):
    if s[j]!=s[((n-1)//2)-1+j]:
      ans="No"
    if s[((n+3)//2)-1+j]!=s[n-1-j]:
      ans="No"
print(ans)

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(s[:half_1], s[half-1:half_1:-1] )
    #print(s[l:l+half_2], s[-1:l+half_2:-1])
#

    if half % 2 != 0 and s[:half_1] == s[half-1:half_1:-1] and s[l:l+half_2] == s[-1:l+half_2:-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] 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()
def is_palindrome(s):
    return s == s[::-1]

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

Submission status: Wrong Answer

Solution code:
# ABC159_B
s=input()
n=len(s)
# if n==1:
#     print('No')
#     exit()

n=n//2
f=''
e=''
f=s[:n]
e=s[-n:]
# print(f,e)
for i in range(int(n//2)+1):
    if f[i]==f[-1-i]:
        pass
    else:
        print('No')
        exit()
    if e[i]==e[-i-1]:
        pass
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
str = input()
list_str = list(str)

pal = "Yes"

for i in range(len(list_str) // 2):
  if list_str[i] != list_str[len(list_str) - 1 - i]:
    pal = "No"
    break

str_half = []

for i in range((len(list_str) // 2)):
  str_half.append(list_str[i])
  
if len(str_half) <= 2:
  pal = "No"
else:
  for i in range(len(str_half) // 2):
    if str_half[i] != list_str[len(str_half) - 1 - i]:
      pal = "No"
      break

str_any = []

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

if len(str_any) <= 2:
  pal = "No"
else:
  for i in range(len(str_any) // 2):
    if str_any[i] != list_str[len(str_any) - 1 - i]:
      pal = "No"
      break

print(pal)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
j1 = S[:int((N+1)/2-1)] == S[int((N+1)/2):]

j2_str = S[0:int((N-1)/2)]
l2 = len(j2_str)
if l2%2==0:
    j2 = j2_str[:int((l2)/2)] == j2_str[int((l2)/2+1):]
else :
    j2 = j2_str[:int((l2-1)/2)] == j2_str[int((l2-1)/2+1):]

j3_str = S[int((N+3)/2-1):]
l3 = len(j3_str)
if l3%2==0:
    j3 = j3_str[:int((l3)/2)] == j3_str[int((l3)/2+1):]
else :
    j3 = j3_str[:int((l3-1)/2)] == j3_str[int((l3-1)/2+1):]

if N>=7:
    if j1&j2&j3:
        ans = 'Yes'
    else :
        ans = 'No'
elif N==5:
    if S[0]==S[1]==S[3]==S[4]:
        ans='Yes'
    else :
        ans='No'
else :
    if S[0]==S[2]:
        ans = 'Yes'
    else :
        ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
#input
S = input()

#output
N = len(S)
k = N//2
l = (N-3)//4
m = (3*N-1)//4
if (S[0:k] == S[-1:k:-1] )and (S[0:l] == S[(N-3)//2:l:-1]) and (S[(N+1)//2:m] == S[N-1:m:-1]):
    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')