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()
N = len(S)

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

sub1 = S[0:(N-1)//2]
sub2 = S[(N+3)//2-1:N]

print(checkPalindrome(S) and checkPalindrome(sub1) and checkPalindrome(sub2))

Submission status: Wrong Answer

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

if s[0:n//2] == s[n//2+1:n]:
    r = n//2
    le = r//2
    if s[0:le] == s[r-le:r]:
        if s[r+1:r+1+le] == s[n-le:n]:
            sss = "Yes"
            
print(sss)

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
n1=((n-1)//2)
n2=(n+3)//2
s1=s[0:n1]
s2=s[n2-1:]
if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

left = int((n-1)/2)
right = int((n+3)/2 - 1)

if s[0:left] == s[right:n]:
    if (n + 1) % 4 == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()

n=len(S)
s1,s2=S[:(n-1)//2],S[(n+3)//2-1:]
lim=(n-1)//2
for i in range(lim):
  if s1[i]!=s1[-(i+1)] or s2[i]!=s2[-(i+1)]:
    print('No')
    exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
cnt=0
for i in range(0, int((len(S)-1)/2)):
    #print(S[i])
    #print(S[-(i+1)])
    if S[i]==S[-(i+1)]:
        cnt+=1
        
if cnt ==int((len(S)-1)/2):
    #print ('OK')
    cnt=0
    S=S[0:int((len(S)-1)/2)]

    for i in range(0, int((len(S)-1)/2)):
        #print(S[i])
        #print(S[-(i+1)])
        if S[i]==S[-(i+1)]:
            cnt+=1
    #print(S)
    #print(cnt)
    
    if cnt ==int((len(S)-1)/2) and cnt>0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

first = s[:int((len(s)-1)/2)]
last  = s[int((len(s)+2)/2):]

isOK = True if len(s) >= 7 else False

for i in range(int(len(first)/2)):
    if first[i] != first[len(first)-i-1]:
        isOK = False
    
    if last[i] != last[len(last)-i-1]:
        isOK = False

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

Submission status: Wrong Answer

Solution code:
text = str(input())
n = len(text)
target = (n-1)//2

bef = text[:target]
aft = text[target+1:]

if bef == aft[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
def c1(S):
    N=len(S)
    if S[:N//2] == S[N:N//2:-1]:
        return True
    else:
        return False
S=input()
N=len(S)
SS=S[:(N-1)//2]
SSS=S[(N+3)//2-1:]
print(SS,SSS[::-1])
if SS==SSS[::-1] and c1(SS):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def is_par(s):
    l, r = 0, len(s) -1
    while l <= r:
        if s[l] != s[r]:
            return False
        l += 1
        r -= 1
    return True

S = input()
N = len(S)

if is_par(S[0:(N-1)//2]) and is_par(S[(N+3)//2 - 1:]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
str = input()
resp = True
for i in range(0, int(len(str) / 2)):
    if str[i] != str[len(str) - i - 1]:
        resp = False
        break
print(resp)

Submission status: Wrong Answer

Solution code:
def isKaibun(s):
  i = 0
  ans = True
  l = len(s)//2
  while i < l:
    if s[i] != s[-1-i]:
      ans = False
      break
    i += 1
  return ans

S = list(" "+input())
N = len(S)-1
if isKaibun(S[1:(N-1)//2+1]) and isKaibun(S[(N+3)//2:]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def strong(s):
  N=len(s)
  tail = (N-1)//2
  s0=s[0:tail]
  head = (N+3)//2
  s1=s[head-1:]
  return kalin(s0) and kalin(s1) and kalin(s)  

S=input()

print(strong(S))

Submission status: Wrong Answer

Solution code:
S = str(input())
def palindrome(string): 
    return True if string==string[::-1] else False

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

Submission status: Wrong Answer

Solution code:
S = input()

halfLength = len(S) // 2
mae = S[:halfLength] 
ushiro = ''.join(list(reversed(S[halfLength+ 1:])))
answer = 'No'
if mae == ushiro:
    mae_halflen =  len(mae) // 2
    mae_mae = mae[mae_halflen:] 
    mae_ushiro = ''.join(list(reversed(mae[:mae_halflen + 1])))
    if (mae_mae == mae_ushiro):
         answer = 'Yes'
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
if S == list(reversed(S)) and S[-3:] == list(reversed(S[-3:])) and S[:3] == list(reversed(S[:3])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = True
for i in range(N):
  if S[i] != S[-1-i]:
    ans = False
    break

M = N // 2
for i in range(M):
  if S[i] != S[M-1-i]:
    ans = False
    break

for i in range(M):
  if S[M+1] != S[-1-i]:
    ans = False
    break

print('Yes' if ans else 'No')

Submission status: Wrong Answer

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

def is_kaibun(x):
    if list(reversed(x)) == list(x):
        return True
    else:
        return False
      
if is_kaibun(S[:((N-1)//2)]) and is_kaibun(S[((N+2)//2):]):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin


def check_palindrome(str_):
    if str_ == str_[::-1]:
       return True
    return False

def get_result(data):
    S = data[0]
    right_idx = int((len(S) - 1) / 2)
    left_idx = int((len(S) + 3) / 2) - 1
    right_S = S[0:right_idx]
    left_S = S[left_idx:]
    if check_palindrome(S) and check_palindrome(right_S) and check_palindrome(left_S):
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    data = list(map(str, stdin.readline().split(' ')))
    result = get_result(data)
    print(result)

Submission status: Wrong Answer

Solution code:
def B():
    S = input()
    if not S:
        print('No')
        return
    for i in range(len(S)//4):
        # print(S[i], S[len(S)//2-i-1], S[len(S)//2+i+1], S[-i-1])
        if not (S[i] == S[(len(S)-1)//2-i-1] == S[(len(S)+3)//2+i-1] == S[-i-1]):
            print('No')
            return
    print('Yes')
B()

Submission status: Wrong Answer

Solution code:
inp = input()
part1 = inp[0:int((len(inp)-1)/2)]
part2 = inp[int((len(inp)+1)/2):]


def isParin(S):
    n = len(S)
    flg = 0
    for i in range(int(n/2)):
        if S[i] != S[n-1-i]:
            flg += 1
    if flg == 0:
        return True
    else:
        return False


if isParin(inp):
    if isParin(part1) and isParin(part2):
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    N = len(S)
    P = S[:(N-1)//2]
    Q = S[(N+3)//2 - 1:]
    M = len(P)
    K = len(Q)
    if (S[:N//2] == S[N//2 + 1:]) and \
            (P[:M//2] == P[(M//2 + 1 if M % 2 == 1 else M//2):]) and \
            (Q[:K//2] == Q[(K//2 + 1 if K % 2 == 1 else K//2):]):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#B
S = input()
n = len(S)
a = list(S)
reva = a[n::-1]
sub1 = a[0:(int((n-1)/2))]
sub2 = a[int((n+3)/2-1):]
print([sub1, sub2])
if a == reva and sub1 == sub1[len(sub1)::-1] and sub2 == sub2[len(sub2)::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

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

def main(s):
    l = int((len(s)-1)/2)
    frag1 = judge(s)
    frag2 = judge(s[:l])
    frag3 = judge(s[l+1:])
    if frag1 and frag2 and frag3:
        return 'Yes'
    else:
        return 'No'

print(main(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

ans = 0

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

s5 = s[::-1]
s3 = s1[::-1]
s4 = s2[::-1]

if s1 == s3:
    ans += 1

if s2 == s4:
    ans += 1

if s == s5:
    ans += 1
if n >= 99:
    ans -= 1

if n % 2 == 0:
    ans -= 1
    
if ans == 3:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import math

def isPalindrome(s):
    n = len(s)
    flag = True
    for i in range(n):
        if i < math.floor(n/2):
            if s[i] == s[n - i - 1]:
                continue
            else:
                flag = False
    return flag


s = str(input())
n = len(s)
medium = math.floor(n/2)
print(isPalindrome(s))
print(isPalindrome(s[0:medium]))
print(isPalindrome(s[medium+1:n]))
if isPalindrome(s) and isPalindrome(s[0:medium]) and isPalindrome(s[medium+1:n]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

S_reverse = ''.join(list(reversed(S)))
index = int((len(S) - 1) / 2)
index2 = int((len(S[:index]) - 1) / 2)

S_reverse_child = ''.join(list(reversed(S[:index])))

if S[:index] == S_reverse[:index]:
  if len(S[:index2]) >= 3 and S[:index2] == S_reverse_child[:index2]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
S_list = [i for i in S]
S_1 = S_list[:(N-1)//2]
check = 0
for i in range(len(S_1)//2+1):
    if S_1[i] != S_1[-(i+1)]:
        check = 1

S_2 = S_list[(N+3)//2-1:]
for i in range(len(S_2)//2+1):
    if S_2[i] != S_2[-(i+1)]:
        check = 1

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
flg = True
i = 0
while i <= (N-3)/2:
    if S[i]!=S[int((N-3)/2-i)]:
        flg = False
    i += 1
i = N-1
while i >= (N+1)/2:
    if S[i]!=S[int((3*N-1)/2-i)]:
        flg = False
    i -= 1
if flg:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

s = input()
result = is_kaibun(s) and is_kaibun(s[:int((len(s) - 1) / 2)]) and is_kaibun(s[int(((len(s) + 3) / 2) - 1):])
print('Yes' if result else 'No')

Submission status: Wrong Answer

Solution code:
def F(x):
    return x[0:len(x)//2] == x[::-1][0:len(x)//2]

s = input()
n = len(s)
sf = s[0:(n-1)//2]
sb = s[(n-1)//2+1:]
if F(sf) and F(sb):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input().rstrip()
N = len(S)
for i in range((N - 1) // 2):
    if S[i] != S[N-1-i]:
        print("No")
        exit(0)
s = S[:(N-1) // 2]
n = len(s)
if n == 2 and s[0] != s[1]:
    print("No")
    exit(0)

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
C = (N-1)//2

l = S[:C]
r = S[-C::][::-1]

rn = len(r) // 2
ll = r[:rn]
rr = r[-rn::][::-1]

if l == r and ll == rr:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s1 = str(input())
s2 = ''
for i in range(len(s1)):
    s2 += s1[- i - 1]
if s1 != s2:
    print('No')
    exit()

t1 = s1[0 : (len(s1) - 1) // 2]
t2 = ''
for i in range(len(t1)):
    t2 += t1[- i - 1]
if t1 != t2:
    print('No')
    exit() 

u1 = s1[(len(s1) + 3) // 2 + 1::]
u2 = ''
for i in range(len(u1)):
    u2 += u1[- i - 1]
if u1 != u2:
    print('No')
    exit() 
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()

for i in range(int(len(a)//2)):
  if a[i] != a[-i-1]:
    print('No')
    exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

halfLen = len(S)//2
if S[0:halfLen//2] == S[halfLen//2+1:halfLen][::-1] and S[halfLen+1:halfLen+1+halfLen//2] == S[len(S)-halfLen//2:len(S)][::-1] and S[0:halfLen] == S[halfLen+1:len(S)][::-1]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()

def is_kaibun(s_):
  s_len = len(s_)
  for i in range(int(s_len / 2)):
    if s_[i] != s_[s_len - i - 1]:
      return False
    else:
      return True
    
c_2 = s[:int((len(s) - 1) /2)]
c_3 = s[int((len(s) + 3) / 2)-1:]

result_1 = is_kaibun(s)
result_2 = is_kaibun(c_2)
result_3 = is_kaibun(c_3)

if result_1 and result_2 and result_3:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = str(raw_input())
N = len(S)
S1 = S[:(N-1)/2]
S2 = S[(N+1)/2:]

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

Submission status: Wrong Answer

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
s = l()
a = s[:len(s)//2]
b = s[len(s)//2+1:]
def f(s):
    n = len(s)-1
    s1 = s[:n//2]
    s2 = s[n//2+1:]
    s2 = s2[::-1]
    if s1 == s2:
        return True
    return False
if len(s) == 3 and f(s):
    print("Yes")
elif f(s) and f(a) and f(b):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    flg = False
    if len(s) % 2 == 0:
        if s[0:int((len(s)/2)-1)] == s[int(len(s)/2):len(s)-1]:
            flg =True
    else:
        if s[0:int((len(s)-1)/2-1)] == s[int((len(s)+1)/2):len(s)-1]:
            flg =  True
    return flg



s = input()
ans = "No"



if kaibun(s):
    if kaibun(s[0:int((len(s)-1)/2-1)]) and kaibun(s[int((len(s)+1)/2):len(s)-1]):
        ans = "Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
N = len(S)
for i in range(int((N-1)/2)):
  if S[i] != S[N-1-i]:
    print('No')
    exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
import math

def check_kai(arr):
    len_a = len(arr)
    check_len = int(math.ceil(len_a/2))
    lef = arr[0:check_len]
    arr.reverse()
    rig = arr[0:check_len]
    if lef == rig:
        return True
    else:
        return False


input = list(input())
N = len(input)

if check_kai(input) and check_kai(input[0:(int((N-1)/2)+1)]) and check_kai(input[int((N+3)/2):]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
print(S[-3:], S[:3])
if S == list(reversed(S)) and S[-3:] == list(reversed(S[-3:])) and S[:3] == list(reversed(S[:3])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

S = input()
mid = len(S)//2
fst = S[:mid]
lat = S[mid+1:]
if fst == lat[::-1]:
    mid = len(fst)//2
    fst_2 = fst[:mid]
    lat_2 = fst[mid+1:]
    if fst_2 == lat_2[::-1]:
        fst_3 = lat[:mid]
        lat_3 = lat[mid+1:]
        if fst_3 == lat_3[::-1]:
            print('yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

s = list(input())
N = len(s)
res = True


for i in range((N - 1) // 2):
    if s[i] != s[N - i - 1]:
        res = False

N = (N - 1) // 2

if N % 2 != 0:
    for i in range((N - 1) // 2):
        if s[i] != s[N - i - 1]:
            res = False
        if s[i +(N+1)//2] != s[N - i - 1+(N+1)//2]:
            res = False
else:
    for i in range(N // 2):
        if s[i] != s[N - i - 1]:
            res = False
        if s[i + (N+1)//2] != s[N - i - 1+(N+1)//2]:
            res = False

if res:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
end_index = int((N-1)/2)
temp = S[0:end_index]
#print(temp)
start = int((N+3)/2-1)
end = N+1
temp2 = S[start:end]
#print(temp2)
if temp == temp[::-1]:
    if temp2 == temp2[::-1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
a=S[:int((N-1)/2)]
b=S[int((N+1)/2):]
b=b[::-1]
if(a==b):
  N=len(a)
  c=a[:int((N-1)/2)]
  d=a[int((N+1)/2):]
  d=d[::-1]
  if(c==d):
    e=b[:int((N-1)/2)]
    f=b[int((N+1)/2):]
    f=f[::-1]
    if(e==f):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
N = len(S)
M = (N-1)//2
S1 = S[:(N-1)//2]
S2 = S[(N+3)//2-1:]
S2.reverse()
S11 = S1[:(M-1)//2]
S12 = S1[(M+3)//2-1:]
S12.reverse()

if S1 == S2 and S11 == S12:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
r = (n-1)//2
l = (n+3)//2
for i in range(r):
  if not (s[i] == s[r-i-1] or s[l-1+i] == s[n-1-i]):
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
def check(s):
	l = len(s)
	c = 1

	if l != 1:

		if l % 2 == 1:
			l -= 1

		for i in range(int(l/2)):
			if s[i] != s[0-1-i]:
				c = 0

	return c

if __name__ == '__main__':
	S = input()
	LEN = len(S)
	l = int((LEN-1)/2)

	r = l+1
	s1 = S[0:l]
	s2 = S[r:LEN]

	c = check(s1) * check(s2)

	if c == 1:
		print('Yes')
	else:
		print('No')

Submission status: Wrong Answer

Solution code:
a = input()
def p(s,n):
    for i in range(n//2):
        if s[i] != s[-(i+1)]:
            return 0
    return 1
r = len(a)
print(a[(r+3)//2-1:],r-(r+3)//2+1)
if p(a,r) == 1 and p(a[:((r-1)//2)],(r-1)//2) == 1 and p(a[(r+3)//2-1:],r-(r+3)//2+1)== 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
left = ((len(S) - 1) // 2)
right = ((len(S) + 3) // 2) - 1
l_s = S[0:left]
r_s = S[right:len(S)]
if(S == S[::1] and l_s == l_s[::-1] and r_s == r_s[::-1]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = str(input())
judge = True
for i in range(((len(S)-1)//2)//2):
  if not(S[i] == S[len(S)-i-1] == S[(len(S)-3)//2-i] == S[(len(S)+1)//2+i]):
    judge = False
    break
if judge:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()

ans = True

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

for i in range(len(s) // 2) :
    #print(i, len(s) // 2 -1 - i, s[i], s[len(s) // 2 -1 - i])
    if s[i] != s[len(s) // 2 -1 - i] :
        ans = False

#print(ans)

for i in range(len(s) // 2 + 1, len(s)) :
    #print(i, len(s) - i + len(s) // 2 + 1)
    if s[i] != s[len(s) - 1 - i + len(s) // 2 + 1] :
        ans = False

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

Submission status: Wrong Answer

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

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

    print('Yes')


def kaibun_check(L):
    L_ = list(L.__reversed__())
    for s, s_ in zip(L, L_):
        if s != s_:
            print('No')
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

s1 = s[0:int((n-1)/2)]
s1re = "".join(list(reversed(s1)))
s2 = s[int((n+3)/2)-1:]
s2re = "".join(list(reversed(s2)))
if s1 == s1re and s2 == s2re:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=raw_input()
flag=0
s1=s[::-1]
# print s1
if s1!=s:
  print "NO"
  exit(0)
s1=s[0:(len(s)-1)/2]
s2=s1[::-1]
# print s1
if s1!=s2:
  print "NO"
  exit(0)

print "YES"

Submission status: Wrong Answer

Solution code:
import math
import sys 
s = input()
if s==s[::-1]:
    n = len(s)
    right = int((n-1)/2)
    print(right)
    tmp = s[:right]
    if tmp == tmp[::-1]:
        left = int((n+3)/2)
        tmp2 = s[left-1:]
        if tmp2 == tmp2[::-1]:
            print('Yes')
            sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
S=input()

N=len(S)
s0=list(S)

a=0
b=0

for i in range((N-1)//2):
    if s0[i]==s0[(N-1)//2-1-i]:
        a=a+1

for i in range((N+3)//2-1,N):
    if s0[i]==s0[N+(N+3)//2-i-2]:
        b=b+1

if a==b==(N-1)//2:
    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)


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

Submission status: Wrong Answer

Solution code:
s = list(input())
x = len(s)
a = s[:x//2]
b = s[x//2+1:]
y = len(a)
c = a[:y//2]
d = a[y//2+1:]
e = b[y//2+1:]
f = b[:y//2]

ans = "No"
if a == b:
    if c == d:
        if a == b:
            ans = "Yes"

if x == 1 or x == 2 or x == 3:
    ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

first = s[:int((len(s)-1)/2)]
last  = s[int((len(s)+2)/2):]

isOK = True

for i in range(int(len(first)/2)):
    if first[i] != first[len(first)-i-1]:
        isOK = False
    
    if last[i] != last[len(last)-i-1]:
        isOK = False

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

Submission status: Wrong Answer

Solution code:
s = list(input())
a = s[:len(s)//2]
b = s[len(s)//2+1:]

flagA = True
for i in range(len(a)//2+1):
  if a[i] != a[len(a)-i-1]:
    flagA = False
    break
    
flagB = True
for i in range(len(b)//2+1):
  if b[i] != b[len(b)-i-1]:
    flagB = False
    break
    
if flagA and flagB:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
ls = []
l1 = (n-1)//2
l2 = (n+3)//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 f:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def checkStr(str):
  n = len(str)
  if n % 2 == 0:
    for i in range(int(n/2)):
      if str[i] != str[n-i-1]:
        return False
  else:
    for i in range(int((n-1)/2)):
      if str[i] != str[n-i-1]:
        return False
  return True


s = input()
print(checkStr(s[0:int((len(s)-1)/2)]) and checkStr(s) and checkStr(s[int((len(s)+3)/2)-1:]))

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
S_list = [i for i in S]
S_1 = S_list[:(N-1)//2]
check = 0
for i in range(len(S_1)//2+1):
    print(S_1[i], S_1[-(i+1)])
    if S_1[i] != S_1[-(i+1)]:
        check = 1

S_2 = S_list[(N+3)//2-1:]
for i in range(len(S_2)//2+1):
    print(S_2[i], S_2[-(i+1)])
    if S_2[i] != S_2[-(i+1)]:
        check = 1

print(S_1, S_2)
if check == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

for i in range (a//2):
  if s[i]!=s[a-1-i]:
    print ('No')
    exit()
    
for j in range (b//2):
  if s[i]!=s[b-1-i]:
    print('No')
    exit()
    
for k in range (c//2):
  if s[i]!=s[c-1-i]:
    print('No')
    exit()
    
print('Yes')

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(s) % 2 == 0:
		print("No")
		exit()
#	print(s, front, front[:(len(front)-1)//2], front[(len(front)+3)//2-1:])
	if  front[:(len(front)-1)//2] == front[(len(front)+3)//2-1:] and  end[:(len(front)-1)//2] == end[(len(front)+3)//2-1:]:
		print("Yes")
	else:
		print("No")

main()

Submission status: Wrong Answer

Solution code:
S=input()

n=len(S)
s1,s2=S[:(n-1)//2],S[(n+3)//2-1:]
lim=(n-1)//2
for i in range(lim):
  if lim%2!=0 and i==lim//2: break
  if s1[i]!=s1[-(i+1)] or s2[i]!=s2[-(i+1)]:
    print('No')
    exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

s = input()

s_len = len(s)

pre_half_str = s[0:int((s_len-1)/2)]
latter_half_str = s[int((s_len+2)/2):]

if "".join(reversed(pre_half_str)) == pre_half_str:
    if "".join((reversed(latter_half_str))) == latter_half_str:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

Solution code:
import math
s = list(input())
n = len(s)

aa = math.floor((n - 1) / 2)
bb = math.ceil((n + 3) / 2)
a = s[0:aa]
b = s[bb - 1:n]

alen = len(a)
blen = len(b)

for i in range(alen):
    if a[i] != a[alen - i - 1]:
        print("No")
        exit()

for i in range(blen):
    if b[i] != b[blen - i - 1]:
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
 
cnt = 1
l = len(s)
l1 = l//2
for i in range(l1):
  if s[i] != s[l-1-i]:
    cnt = 0
 
for i in range(l1//2):
  if s[i] != s[l1//2-1-i]:
    cnt = 0
 
for i in range(l1//2):
  if s[l1//2+1+i] != s[l-1-i]:
    cnt = 0
if cnt == 0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

def cal(a,b):
    for i in range((b-a+1)//2):
        if S[a+i] != S[b-i]:
            return 1
            break
    else:
        return 0
if cal(0,N-3//2) == 0 and cal(N+1//2,N-1) == 0 and cal(0,N-1) == 0:
    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+1)/2):]
b=b[::-1]
if(a==b):
  N=len(a)
  c=a[:int((N-1)/2)]
  d=a[int((N+1)/2):]
  d=d[::-1]
  if(c==d):
    e=b[:int((N-1)/2)]
    f=b[int((N+1)/2):]
    if(e==f):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = (input())
#a,b = map(int,input().split())
n = len(s)
b = n//2
s1 = s[0:b]
s2 = s[b+1:]
#print(s1,s2)
flag1,flag2 = True,True
for i in range(len(s1)//2):
    if s1[i] == s1[-i-1]:
        flag1 = True
    else:
        flag1 = False
        break
for i in range(len(s2)//2):
    if s2[i] == s2[-i-1]:
        flag2 = True
    else:
        flag2 = False
        break
if flag1 and flag2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

ans = True
for i in range(N//2):
    if S[i] == S[-1-i]:
        pass
    else:
        ans = False
        
M = (N-1)//2

for i in range(M//2):
    if S[i] == S[-M-i]:
        pass
    else:
        ans = False
        
L = (N+3)//2

for i in range((N-L)//2):
    if S[L+i-1] == S[-1-i]:
        pass
    else:
        ans = False
        
if ans:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
S = list(input())
n0 = len(S)
def kaibun(S):
    c = 0
    N = len(S)
    n = N // 2
    for i in range(n):
        if S[i] != S[N-1-i]:
            c = 1
            break
    return c
if kaibun(S) == 0:
    s1 = S[0:n0 //2 ]
    s2 = S[n0 // 2 +1:n0]
    if kaibun(s1) == 0 and kaibun(s2) == 0:
        print("Yes")
    else:
        print("No")
else:
  print("No")

Submission status: Wrong Answer

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

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

    print('Yes')


def kaibun_check(L):
    L_ = list(L.__reversed__())
    for s, s_ in zip(L, L_):
        if s != s_:
            print('No')
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
left = S[:N // 2]
right = S[N // 2 + 1:]
last = S[(N+3)//2-1:]

print('Yes') if left == left[::-1] and right == right[::-1] and last == last[::-1] else print('No')

Submission status: Wrong Answer

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


def f(s):
    n = len(s)
    if n % 2 == 0:
        return s[:n // 2] == s[n // 2:]
    else:
        return s[:n // 2] == s[n // 2 + 1:]


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

Submission status: Wrong Answer

Solution code:
s= input()

s_r = s[::-1]
N = len(s)
s_2 = s[:int((N-1)/2)]
s_3 = s[int((N+1)/2):]
print(s_r, s_2, s_3)
if ( (s == s_r) & (s_2 ==s_2[::-1]) &(s_3 ==s_3[::-1])):
  print('Yes')
else :
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

S1 = S[: (len(S) - 1) // 2]
S2 = S[(len(S) + 3) // 2 - 1 :]
# print(S, S1, S2)


def f(a):
    res = "".join(list(reversed(a)))
    return res


if S1 == f(S1) and S2 == f(S2):
    print("Yes")
else:
    print("No")