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: Accepted

Solution code:
S=input()
N=len(S)
i=0
if((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+1)):
        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+1)):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
s=input()

s2 = ''.join(list(reversed(s)))
if s!=s2: print("No")
else:

    e = int((len(s)-1)/2)
    s1=s[:e]
    s2 = ''.join(list(reversed(s1)))
    if s1!=s2: print("No")
    else:
        e = int((len(s)+3)/2)-1
        s1=s[e:]
        s2 = ''.join(list(reversed(s1)))
        if s1!=s2: print("No")
        else: print("Yes")

Submission status: Accepted

Solution code:
s = input()
n1 = int(len(s)/2)
n2 =  int(n1/2)
t1 = s[:n1]
t2 = s[::-1][:n1]
if t1 == t2 and t1[:n2] == t1[::-1][:n2] and t2[:n2] == t2[::-1][:n2] :
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
j1 = S == S[::-1]

j2_str = S[0:int((N+1)/2-1)]
j2 = j2_str == j2_str[::-1]


j3_str = S[int((N+3)/2-1):]
j3 = j3_str == j3_str[::-1]

if j1&j2&j3:
    ans = 'Yes'
else :
    ans = 'No'
print(ans)

Submission status: Accepted

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')
elif x == t and t%2 == 0:
    k = int(t/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: Accepted

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

S_list_reverse = list(reversed(S_list))


#print(S_list_reverse)
#print(S_list)

if(S_list != S_list_reverse):
  print("No")
else:
  S_list_new = S_list
  del S_list_new[int(len(S_list)/2):]
  S_list_new_reverse =  list(reversed(S_list_new))
  if(S_list_new != S_list_new_reverse):
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    s = list(input())
    n = len(s)
    srev = list(reversed(s))
    if not s == srev:
        print(no)
        exit()
    if not s[:(n-1)//2] == srev[1+(n-1)//2:]:
        print(no)
        exit()
    if not srev[:(n-1)//2] == s[1+(n-1)//2:]:
        print(no)
        exit()
    print(yes)



main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
f=1
for i in range((n-1)//2):
    if s[i]!=s[n-i-1]:
        f=-1
        break
if f==1:
    for i in range((n-1)//4):
        if s[i]!=s[(n-3-2*i)//2]:
            f=-1
            break
    
if f==1 and n!=3:
    for i in range((n+1)//2,(3*n+3)//4):
            if s[i]!=s[n-i-1]:
                f=-1
                break

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

Submission status: Accepted

Solution code:
S  = input()
N = len(S)
n1,n2 = ((N-1)/2),(N+3)/2
n1,n2 = int(n1),int(n2)
sh,st = S[:n1],S[n2-1:N]

if sh == sh[::-1] and st == st[::-1] and S==S[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ans = 'No'
cnt = 0
for i in range(int((N - 1) / 2) - 1):
    if S[i] == S[(-1) - i]:
        continue
    else:
        break
else:
    for i in range(int((N + 3) / 2) - 1, N - 1):
        if S[i] == S[(-1) - cnt]:
            cnt += 1
            continue
        else:
            break
    else:
        ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
import sys
s = input()

n = len(s)
m = int((n-1)/2)
b = s[:m]

for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
m = int((n+3)/2)
b = s[m-1:]
m= len(b)
for i in range(int(m/2)):
    if b[i:(i+1)] != b[(m-i-1):m-i]:
        print('No')
        sys.exit()
for i in range(int(n/2)):
    if s[i:(i+1)] != s[(n-i-1):n-i]:
        print('No')
        sys.exit()  
print('Yes')

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
flag = True
for i in range((N+1)//2-1):
    if S[i] != S[-1-i]:
        flag = False

mae = S[:((N-1)//2)]
ato = S[(N+3)//2-1:]

N = len(mae)
if N%2 == 1:
    for i in range((N+1)//2-1):
        if mae[i] != mae[-1-i]:
            flag = False
    for i in range((N+1)//2-1):
        if ato[i] != ato[-1-i]:
            flag = False
else:
    for i in range((N+1)//2):
        if mae[i] != mae[-1-i]:
            flag = False
    for i in range((N+1)//2):
        if ato[i] != ato[-1-i]:
            flag = False

if flag == True:
    print('Yes')
elif flag == False:
    print('No')

Submission status: Accepted

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 = (N-1)//4
            if a%2 == 0:
                if S[:b] == S[b:a][::-1]:
                    c = (N+3)//2; d = c+(N-c)//2
                    if (N-c)%2 == 0:
                        if S[c-1:d-1] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(7, S, N)
                    else:
                        if S[c-1:d] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(6, S, N)
                #else: print(8, S, N)
            else:
                if S[:b] == S[b+1:a][::-1]:
                    c = (N+3)//2; d = c+(N-c)//2
                    if (N-c)%2 == 0:
                        if S[c-1:d-1] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(5, S, N)
                    else:
                        if S[c-1:d] == S[d:][::-1]:
                            print('Yes')
                            sys.exit()
                        #else: print(4, S, N)
                #else: print(3, S, N)
        #else: print(2, S, N)
    #else: print(1, S, N)
    print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
q1 = 0
q2 = 0
q3 = 0
num = len(S)
num_2 = int((num -1)/2)
num_3 = int((num +3)/2-1)


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

q1 = ispalindrome(S)

S_2 = S[0:num_2]
q2 = ispalindrome(S_2)

S_3 = S[num_3:num]
q3 = ispalindrome(S_3)

if q1 == 1 and q2 == 1 and q3 == 1:
  print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
#一文字めから(N-1)//2文字目まで
mo1=s[:(len(s)-1)//2]
#(N+3)//2文字目から最後まで
mo2=s[(len(s)+3)//2-1:]

ans=["Yes","Yes","Yes"]

for i in range(len(s)//2):
    #(s[i],s[-(i+1)])
    if s[i]!=s[-(i+1)]:
        ans[0]="No"
        break

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

for i in range(((len(s)+3)//2)//2):
    #print(mo2[i],mo2[-(i+1)])
    if mo2[i]!=mo2[-(i+1)]:
        ans[2]="No"
        break

if "No" in ans:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

m = N//2 +1
l = S[:m-1]
r = S[m:]

def chk(str_):
	leng = len(str_)
	if leng == 1:
		return True
	elif leng%2 == 2:
		ll = str_[:leng//2]
		rr = str_[leng//2:]
	else:
		ll = str_[:leng//2]
		rr = str_[leng//2:]
	for a, b in zip(ll, reversed(rr)):
		if a != b:
			return False
	return True

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

Submission status: Accepted

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

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

A = int((n-1)/2)
B = int((n+3)/2)
# print(s[0 : A])
# print(s[B-1 : n])
# print(s[0 : A] == str(''.join(list(reversed(s[0 : A])))) )
# print(s[B-1 : n] == str(''.join(list(reversed(s[B-1 : n])))) )
# print(s == s[::-1])

if s[0 : A] == str(''.join(list(reversed(s[0 : A])))) and s[B-1 : n] == str(''.join(list(reversed(s[B-1 : n])))) and s == s[::-1]:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
s=input()
if len(s)%2==1:

    n1=(len(s)-1)//2
    n2=(len(s)+2)//2
    s1=s[0:n1]
    s2=s[n2:len(s)]
    if s==s[::-1] and s1==s1[::-1] and s2==s2[::-1]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# bin/env/pypy3
import sys
import collections
import heapq
import math
s = sys.stdin.readline().split()[0]
n = len(s)

def isP(s1):
    # for i in range(len(s)//2):
    #print(s1)
    n1 = len(s1)
    #print(s1[::-1],s1,str(reversed(s1))==s1)
    #print(s1 == s1[::-1])
    return s1==s1[::-1]
    #print(s1)
    #print(i,n-2-i,s[i],s[n-2-i])
    #for i in range(n1//2):
        #print(s1[i],i,s1[n1-1-i],n1-1-i)
    #    if not (s1[i] != s1[n1-1-i]):
    #        return False
    #return True
#print(isP(s),isP(s[:(n-1)//2]),isP(s[((n+3)//2)-1:]))
if isP(s) and isP(s[:(n-1)//2]) and isP(s[(n+3)-1//2:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
f = 0
a = 0; b = 0; c = 0
if len(s)==3 and s[0]==s[2]:
    print('Yes')
else :
    
    for i in range(len(s)//2):
        if s[i]==s[-1-i]:
            a += 1
        if a == len(s)//2:
            f += 1
    for i in range(len(s)//4):
        if s[i]==s[(len(s)-1)//2-1-i]:
            b += 1
        if b == len(s)//4:
            f += 1
        if s[(len(s)+3)//2-1+i]==s[len(s)-1-i]:
            c += 1
        if c == len(s)//4:
            f += 1
    print('Yes' if f == 3 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'Yes'
for i in range(N):
    if S[i] != S[N-i-1]:
        ans = 'No'
        #print(1)
    if i < (N-1)/2:
        if S[i] != S[N//2-i-1]:
            ans = 'No'
            #print(2)
    elif i >= N//2+1:
        if S[i] != S[N-i+N//2]:
            ans = 'No'
            #print(3)
print(ans)

Submission status: Accepted

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+3)//2-1:]
if F(sf) and F(sb) and F(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
ostr = input()

slist = list(ostr)
length = len(slist)
half = length // 2

flg1 = True
flg2 = True
flg3 = True

len2 =  (length-1)//2
list2 = slist[:len2]
half2 = len(list2) // 2

len3 = ((length+3)//2)-1
list3 = slist[len3:]
half3 = len(list3) // 2

def judge(s, h):
    for i in range(1, h+1):
        if s[i-1] != s[-i]:
            return False
    return True

flg1 = judge(slist, half)
flg2 = judge(list2, half2)
flg3 = judge(list3, half3)
if flg1 and flg2 and flg3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S = input()
N = len(S)

befor = S[0:(( N ) // 2)]
after = S[(( N + 1) // 2):N]
if ( befor == after ) :
    print("Yes")
else :
    print("No")

Submission status: Accepted

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-1])

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: Accepted

Solution code:
S = list(input())

import sys
import math
flag1 = 0
flag2 = 0
flag3 = 0

if S == S[::-1]:
    flag1 = 1
else:
    print('No')
    sys.exit()

S1 = S[:(int((len(S) - 1)/2))]
if S1 == S1[::-1]:
    flag2 = 1
else:
    print('No')
    sys.exit()

S2 = S[int((len(S)+3)/2) - 1:]
if S2 == S2[::-1]:
    flag3 = 1
else:
    print('No')
    sys.exit()

if flag1 == 1 and flag2 == 1 and flag3 == 1:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()

ind = (len(S) + 1) // 2

left = S[:ind-1]
right = S[ind:]

def check(x):
    if len(x) % 2 == 0:
        ind = len(x) // 2
        if x[:ind] == x[ind:][::-1]:
            return True
        else:
            return False
    else:
        ind = (len(x) + 1) // 2
        if x[:ind-1] == x[ind:][::-1]:
            return True
        else:
            return False

if check(S) and check(left) and check(right):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math

s = input()
n = len(s)

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

sm = int((n + 1) / 2)
s1m = math.ceil(len(s1) / 2)
s2m = math.ceil(len(s2) / 2)

if len(s1) % 2 == 0 or len(s2) % 2 == 0:
    if s[0 : sm - 1] == s[sm : n] \
    and s1[0 : s1m] == s1[s1m : int(len(s1))][::-1] \
    and s2[0 : s2m] == s2[s2m : int(len(s2))][::-1]:
        print("Yes")
    else:
        print("No")
else:
    if s[0 : sm - 1] == s[sm : n] \
    and s1[0 : s1m - 1] == s1[s1m : int(len(s1))][::-1] \
    and s2[0 : s2m - 1] == s2[s2m : int(len(s2))][::-1]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s = list(input())
n = (len(s) - 1) // 2

if s == s[::-1]:
    x = s[:n]
    if x == x[::-1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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)
l.reverse()
A = ''.join(l)

b = ''.join(m)
m.reverse()
B = ''.join(m)

t = s
t.reverse()
x = ''.join(s)
y = ''.join(t)

if (a==A and b==B and a == b):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

flag = True

S_r = S[::-1]

if S != S_r:
    flag = False


s_a = ""
for i in range((l-1)//2):
    s_a += S[i]

s_a_r = s_a[::-1]

if s_a != s_a_r:
    flag = False

s_b = ""
for i in range((l+2)//2,l):
    s_b += S[i]
s_b_r = s_b[::-1]

if s_b != s_b_r:
    flag = False

if flag:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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():
  s1 = input()
  n = len(s1)
  s2=s1[0:int((n-1)/2)]
  n2 = len(s2)
  s3=s1[int((n+3)/2-1):n]
  n3 = len(s3)
  tf = 'True'
  for i in range(n//2):
    if s1[i]!=s1[n-1-i]:
      tf='False'
  for i in range(n2//2):
    if s2[i]!=s2[n2-1-i]:
      tf='False'
  for i in range(n3//2):
    if s3[i]!=s3[n3-1-i]:
      tf='False'
  if tf=='True':
    print('Yes')
    
  else:
    print('No')
      
  
  

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
S=input()
N=len(S)
def P(S,N):
	if S[0:(N-1)//2]!=S[(N+1)//2:]:
		return "No"
	elif S[0:(N-1)//2]!=S[0:(N-1)//2][::-1]:
		return "No"
	else:
		return "Yes"
print(P(S,N))

Submission status: Accepted

Solution code:

def main():
    s = input()
    sr = s[::-1]

    N = int(len(s))
    s1 = s[:int((N-1)/2)]
    s1r = s1[::-1]
    s2 = s[int((N+1)/2):]
    s2r = s2[::-1]

    # print(s1)
    #     # print(s1r)
    #     # print(s2)
    #     # print(s2r)
    #     # # return

    for i in range(len(s)-1):
        if s[i] != sr[i]:
            print("No")
            return

    for i in range(len(s1)-1):
        if s1[i] != s1r[i]:
            print("No")
            return

    for i in range(len(s2)-1):
        if s2[i] != s2[i]:
            print("No")
            return

    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
a=len(S)
kai=S[::-1]
c=int((a-1)/2)
kai_mae=S[:c]
kai_ato=S[-c:]
if S==kai and kai_mae==kai_mae[::-1] and kai_ato==kai_ato[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def isKaibun(s):
    l = len(s)
    return all(s[i] == s[-1-i] for i in range(l))
    #return s[:l//2] == s[-1:l//2:-1]

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
result = 'Yes'
for i in range(n):
  if s[i] != s[n- 1 - i]:
    result = 'No'

for i in range(n):
  if i > (n - 1) // 2 - 1:
    break
  if s[i] != s[(n-1)//2 - 1 - i]:
    result = 'No'

for i in range(n):
  if (n+3)//2 - 1 >= i:
    pass
  if s[i] != s[n-1-i]:
    result = 'No'
print(result)

Submission status: Accepted

Solution code:
inputStr = input()
char_list = list(inputStr)

N = len(char_list)

cnt1 = (N - 1)/2
cnt1 = int(cnt1)
cnt2 = (N + 3)/2
cnt2 = int(cnt2)

str1 = []
str2 = []

i = 0
while i < cnt1:
    str1.append(char_list[i])
    i += 1

i = cnt2 -1
while i < N:
    str2.append(char_list[i])
    i += 1

if str1 == str2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if s.find(s[::-1])==0:
    if a.find(a[::-1])==0:
        if b.find(b[::-1])==0:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
x = input()
x_len = len(x)

x_1 = x[0:(x_len-1)//2]
x_2 = x[(x_len+2)//2:]

if x == x[::-1] and x_1 == x_1[::-1] and x_2 == x_2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


kaibun = True
n = len(s)
for i in range(n // 2):
    if s[i] != s[-i - 1]:
        kaibun = False
moji = (n - 1) // 2 - 1
for i in range(moji):
    if s[i] != s[moji - i]:
        kaibun = False
for i in range(moji):
    if s_revers[i] != s[moji - i]:
        kaibun = False
if kaibun:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=list(input())

N=len(S)
i=0


while(True):
  #print(N,i)
  if((S[i]==S[N-i-1]) and (S[i]==S[int(N/2)-i-1])):
    i=i+1
  else:
    print("No")
    break
  if(i==(int((N-1)/2))):
    print("Yes")
    break

Submission status: Accepted

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 = math.ceil((len(s)-1)/2)
  s2 = s[0:n2]
#  print("n:{} s:{}".format(n2,s2))
  if check(s2):
    # (N+3)/2 文字目までの回文判定
    n3 = math.ceil((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: Accepted

Solution code:
def check_2(s):
    n = s.__len__()
    x = (n-1)/2
    x = abs(x)
    x = int(x)
    temp = s[0:x]
    if isPalindrome(temp) == 1:
        return 1
    else:
        return 0

def check_3(s):
    n = s.__len__()
    x = (n + 3) / 2
    x = abs(x)
    x = int(x)
    temp = s[n:x]
    if isPalindrome(temp) == 1:
        return 1
    else:
        return 0
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 1
    return 0

if __name__ == "__main__":
    s = input()
    result = 0
    if isPalindrome(s) == 1:
        result = 1
        if check_2(s) == 1:
            result = 1
            if check_3(s) == 1:
                result = 1
            else:
                result = 0
        else:
            result = 0
    else:
        result = 0
    if result == 1:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s = input()

def is_palindrome(s):
  if s == s[::-1]:
    return True
  else:
    return False

l = len(s)
s_1 = s[0:l//2]
s_2 = s[l//2+1:]

if is_palindrome(s) and is_palindrome(s_1) and is_palindrome(s_2):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-22 20:59:36 +0900
# LastModified: 2020-03-22 22:25:25 +0900
#


import os
import sys


def main():
    S = input()
    N = len(S)
    S_b = S[:(N-1)//2]
    S_a = S[(N+1)//2:]
    for i in range((N+1)//2-1):
        if S[i]!=S[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_b)+1)//2):
        if S_b[i]!=S_b[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_a)+1)//2):
        if S_a[i]!=S_b[-(i+1)]:
            print("No")
            return 
    print("Yes")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[k])
        for l in range(int((n-1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-1)/4)):
            e.append(b[m])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[k])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-3)/4)):
            e.append(b[m])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')

Submission status: Accepted

Solution code:
wholeString = input()
firstSub = wholeString[0:int((len(wholeString)-1)/2)]
secondSub = wholeString[int(((len(wholeString)+3)/2)-1):]

if len(wholeString) % 2 == 0 or len(wholeString) < 3 or len(wholeString) > 99:
  print("No")
if firstSub == firstSub[::-1] and secondSub == secondSub[::-1] and wholeString == wholeString[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = str(input())
n = int(len(s))
inversion_s = s[::-1]
palindrome_0 = ""

for _ in range(int((n-1)/2)):
    palindrome_0 += s[_]

inversion_palindrome_0 = palindrome_0[::-1]

palindrome_1 = ""
for _ in range(int((n+3)/2) - 1, n):
    palindrome_1 += s[_]

inversion_palindrome_1 = palindrome_1[::-1]

if s == inversion_s:
    if palindrome_0 == inversion_palindrome_0:
        if palindrome_1 == inversion_palindrome_1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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):]):
    if isKaibun(letter):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

	return True

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

Submission status: Accepted

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

    else:
        if s[:int((len(s)-1)/2)] == ''.join(list(reversed(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: Accepted

Solution code:
s  = input()

n = len(s)

a = s[:n-1//2]
b = a[::-1]

x = s[(n+3)//2-1:]
y = x[::-1]

for i in range(len(s)):
    if s[i] ==s[-i-1] and a  == b and x == y:
        print('Yes')
        break

else:print('No')

Submission status: Accepted

Solution code:
S=input()
N=len(S)
ans="Yes"
for i in range(N):
    if S[i]!=S[-i-1]:
        ans="No"

c=S[:(N-1)//2]
for i in range(len(c)):
    if c[i]!=c[-i-1]:
        ans="No"

d=S[(N-1)//2+1:]
for i in range(len(d)):
    if d[i]!=d[-i-1]:
        ans="No"

print(ans)

Submission status: Accepted

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


s = input()



sl = []
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: Accepted

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

for i in range(N // 2):
    if S[i] == S[i * (-1) - 1]:
        continue
    else:
        print("No")
        sys.exit()
for i in range(N // 4):
    index = int(i * (-1) - 1 - (N-1)/2 - 1)
    if S[i] == S[index]:
        continue
    else:
        print("No")
        sys.exit()
for i in range(N // 4):
    index = int(i + (N+3)/2-1)
    if S[index] == S[i * (-1) - 1]:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
A = list(input())
for i in range(len(A)//2):
  if A[i] == A[len(A)-i-1]:
    continue
  else:
    print('No')
    exit()
for k in range(len(A)//2//2):
  if A[k] == A[(len(A)-1)//2-k-1]:
    continue
  else:
    print('No')
    exit()
for l in range(len(A)//2//2):
  if A[(len(A)+3)//2+l-1] == A[len(A)-l-1]:
    continue
  else:
    print('Notice')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
S0 = input()
N = len(S0)
S1 = S0[:(N - 1) // 2]
S2 = S0[((N + 3) // 2) - 1:]

def isPal(a):
    if(len(a) % 2 == 0):
        l = len(a) // 2
    else:
        l = (len(a) - 1) // 2

    for i in range(l):
        if (a[i-1] != a[-i]):
            return False

    return True

if (isPal(S0) and isPal(S1) and isPal(S2)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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-1):int(kai)]
#print(B)
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: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

if is_kaibun(S) == False:
    print('No')
elif is_kaibun(left) == False:
    print('No')
elif is_kaibun(right) == False:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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