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:
str = input()
rev_str = str[::-1]
len_str = len(str)

pre_str = str[0:((len_str-1)//2)]
pro_str = str[(((len_str+3)//2)-1)::]

#print(pre_str)
#print(pro_str)


rev_pre_str = pre_str[::-1]
rev_pro_str = pro_str[::-1]

pali = 0

if str == rev_str:
    if pre_str == rev_pre_str:
        if pro_str == rev_pro_str:
            pali = 1

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

Submission status: Accepted

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

def check(str):
    return str==''.join(reversed(list(str)))

if check(S) and check(a) and check(b):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

import sys

N = len(S)

be = S[:N//2]
af = S[N//2+1:]

if S == ''.join(list(reversed(S))):
    if be == ''.join(list(reversed(be))):
        if af == ''.join(list(reversed(af))):
            print("Yes")
            sys.exit()
            
print("No")

Submission status: Accepted

Solution code:
def main():
    S = input()
    N = len(S)
    M = N//2
    for i in range(M//2+1):
        if S[i] == S[M-1-i] == S[M+1+i] == S[N-1-i]:
            continue
        else:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env/ python3
S = input()
#N = int(input())
#A, B, C = input().split()
#N, M = map(int, input().split())

#N = int(input())
#A = [int(x) for x in input().split()]

#H, W = map(int, input().split())
#S = [input() for _ in range(H)]
#print(S[0][1])
N = len(S)
flag = True
for i in range(int((N-1)/2)):
    if S[i] != S[int((N-1)/2)-1-i]:
        flag = False
        break
for i in range(int((N+3)/2), N):
    if S[i] != S[N-1-i]:
        flag = False
        break
if flag: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
import sys
S=input()
N = len(S)
S_re = S[::-1]
S_1 = S[0:(N-1)//2]
S_2 = S[(N+3)//2-1:N]
if S == S_re:
    if S_1 == S_1[::-1]:
        if S_2 == S_2[::-1]:
            print('Yes')
            sys.exit()

print('No')

Submission status: Accepted

Solution code:
s=input()
def chk_palin(s):
    i=0
    j=len(s)-1
    while i<j:
        if s[i]!=s[j]:
            return False
        i+=1
        j-=1
    return True
n=len(s)
if chk_palin(s) and chk_palin(s[:(n-1)//2]) and chk_palin(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())

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

N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_str = input().strip()

def main():
  N = len(input_str)
  input_str_part1 = input_str[:int((N-1)/2)]
  input_str_part2 = input_str[int((N+3)/2)-1:]
  flag0 = input_str == input_str[::-1]
  flag1 = input_str_part1 == input_str_part1[::-1]
  flag2 = input_str_part2 == input_str_part2[::-1]
  if flag0 * flag1 * flag2:
    print("Yes")
  else:
      print("No")
  return

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if s[:(n-1)//2] == ''.join(reversed(s[:(n-1)//2])) and s[((n+3)//2-1):] == ''.join(reversed(s[((n+3)//2-1):])) and s[:(n-1)//2] == s[((n+3)//2-1):]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
kaibun = input()
NList = list(kaibun)
N = len(NList)

T1 = True
T2 = True
T3 = True

for s in range(len(NList)):
    if NList[s] != NList[len(NList) - (s+1)]:
        T1 = False
        break


NList = list(kaibun[0:int((N - 1)/2)])

for s in range(len(NList)):
    if NList[s] != NList[len(NList) - (s+1)]:
        T2 = False
        break

NList = list(kaibun[int(((N+3)/2)-1):N])
for s in range(len(NList)):
    if NList[s] != NList[len(NList) - (s+1)]:
        T3 = False
        break

if T1 and T2 and T3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
Sd = S[:(N-1)//2]
Sdd = S[(N+1)//2:N]
if S == S[::-1] and Sd == Sd[::-1] and Sdd == Sdd[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if (s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]):
	print("Yes")
else:
  	print("No")

Submission status: Accepted

Solution code:
s = input()
f_half = s[:int((len(s) - 1) / 2)]
l_half = s[int((len(s) + 3) / 2 - 1):]

if s == s[::-1] and f_half == f_half[::-1] and l_half == l_half[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
s=[i for i in S]
if s!=list(reversed(s)):
    print("No")
else:
    a=[i for i in s[int((N-1)/2)]]
    if a!=list(reversed(a)):
        print("No")
    else:
        a=[i for i in s[int((N+3)/2-1):N]]
        if a!=list(reversed(a)):
            print("No")
        else:
            print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

s = input()
n = len(s)
if s == s[::-1]:
    t = s[:(n - 1) // 2]
    if t == t[::-1]:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

s1 = s[:int((len(s)-1)/2)]
rev1 = s1[::-1]

s2 = s[int((len(s)+3)/2-1):]
rev2  = s2[::-1]

if s == rev and s1 == rev1 and s2 == rev2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

import sys
stdin = sys.stdin
YES = "Yes"
NO = "No"
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()


s = list(ns())
n = len(s)
ss = s[:(n-1)//2]
sss = s[(n+3)//2-1:]
 
if s == list(reversed(s)) and ss == list(reversed(ss)) and sss == list(reversed(sss)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    def ch(s):
        t=s[::-1]
        if s==t:
            return True
        else:
            return False
        
    S=input()
    N=len(S)
    
    if ch(S) and ch(S[:(N-1)//2]) and ch(S[(N+3)//2-1:]):
        print("Yes")
    else:
        print("No")
        

          
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def kaibun_check(bun):
    if bun == bun[::-1]:
        return True
    else:
        return False
if kaibun_check(S):
    idx = int((len(S) -1)/2)
    if kaibun_check(S[:idx]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
lst=[]
for i in s:
    lst.append(i)
def check(ls):
    ls_=list(reversed(ls))
    if not ls==ls_:
        print('No')
        exit()
check(lst)
n=len(lst)
check(lst[:(n-1)//2])
check(lst[(n+3)//2-1:])
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

import sys


# 回文判定
def is_palindrome(s: str) -> bool:
    """decide if s is palindrome or not.

    example:
        >>> s = "akasaka"
        >>> is_palindrome(s)
        # return nothing
        >>> s = "tokyo"
        >>> is_palindrome(s)
        No

    """
    for i in range(int(len(s) / 2)):
        if s[i] != s[-(i + 1)]:
            print("No")
            sys.exit()


s = str(input())
s_firsthalf = s[:int((len(s) - 1) / 2)]
s_secondhalf = s[int((len(s) + 3) / 2)-1:]

is_palindrome(s)
is_palindrome(s_firsthalf)
is_palindrome(s_secondhalf)

print("Yes")

Submission status: Accepted

Solution code:
S=list(input())

T=list(reversed(S))
SS=S[:len(S)//2]
TT=list(reversed(S[:len(S)//2]))
SSS=S[len(S[:len(S)//2])+1:]
TTT=list(reversed(S[:len(S)//2]))
#print(SSS)
if S==T and SS==TT and SSS==TTT:
      print('Yes')
else:
      print('No')

Submission status: Accepted

Solution code:
s = input()
L = len(s)
flag = 1
flag1 = 1
flag2 = 1
for i in range(L):
    if s[i]!=s[L-i-1]:
        flag = 0
for i in range((L-1)//2):
    if s[i]!=s[(L-1)//2-1-i]:
        flag1 = 0
for i in range((L+3)//2,L):
    if s[i]!=s[(L-1)//2+L-i]:
        flag2 = 0
if flag == 1 and flag1 == 1 and flag2 == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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


txt = 'No'
n1 = (l - 1) // 2
n2 = (l + 3) // 2


if f(s) and f(s[:n1]) and f(s[n2 - 1:]):
    txt = 'Yes'

print(txt)

Submission status: Accepted

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

Submission status: Accepted

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

S00=S[::]
S01=S00[::-1]

S02=S[:(n-1)//2]
S03=S02[::-1]

if S00==S01 and S02==S03:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
ls = list(input())
n = len(ls)
rvls = ls[::-1]

fh = int((n-1) /2)
fhls = ls[:fh]
rvfhls = fhls[::-1]

sh = int((n+3)/2-1)
shls = ls[sh:]
rvshls = shls[::-1]


if ls == rvls and fhls==rvfhls and shls == rvshls:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()
def check(S):
    ret = True
    for i in range(len(S)//2):
        if S[i] != S[-i-1]:
            ret = False
    return ret
if len(S) == 3:
    if S[0] != S[-1]:
        print("No")
    else:
        print("Yes")
    exit()
flag = True
if not check(S):
    flag = False
if not check(S[:(len(S))//2]):
    flag = False
if not check(S[(len(S)+3)//2-1:]):
    flag = False
print("Yes" if flag else "No")

Submission status: Accepted

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

Submission status: Accepted

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

S00 = S[:]
S01 = S00[::-1]
S10 = S[:(n-1)//2]
S11 = S10[::-1]
S20 = S[(n+3)//2-1:]
S21 = S20[::-1]

if S00 == S01 and S10 == S11 and S20 == S21:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()

s_re=s[::-1]
s1=s[0:int((len(s)-1)/2)]
s2=s[int((len(s)+3)/2)-1::]
s1_re=s1[::-1]
s2_re=s2[::-1]

if s==s_re and s1==s1_re and s2==s2_re:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n//2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)//2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
S=input()
N=len(S)
if kaibun(S)==True and kaibun(S[0:(N-1)//2])==True and kaibun(S[(N+3)//2-1:N])==True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:

S = input()

slen = int((len(S)-1)/2)

sleft = S[:slen]
sright = S[slen:]

if sleft in sright:
  print ("Yes")
else:
  print ("No")

Submission status: Accepted

Solution code:
s = input()
def isPalindrome(l, r):
    i = l
    j = r
    while i <= j:
        if s[i] != s[j]:
            return False
        i += 1
        j -= 1
    return True
n = len(s)
if isPalindrome(0, (n - 3) // 2) and isPalindrome(0, n - 1):
    print("Yes\n")
else:
    print("No\n")

Submission status: Accepted

Solution code:
# A = [list(map(int, input().split())) for _ in range(3)]
# k = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
# a, b = map(int, input().split())
S = input()
n = len(S)
judge = True
if S != S[::-1]:
    judge = False
for i, j in zip(S[:n//2], S[n//2+1:]):
    if i != j:
        judge = False
print("Yes") if judge else print("No")

Submission status: Accepted

Solution code:
s1 = list(input())
N = len(s1)
s1_r = s1[::-1]
ans = "No"
cnt = 0
if s1 == s1_r:
    cnt += 1
s2 = s1[:(N-1)//2:]
s2_r = s2[::-1]
if s2 == s2_r:
    cnt += 1
s3 = s1[(N+3)//2-1:]
s3_r = s3[::-1]
if s3 == s3_r:
    cnt += 1
if cnt == 3:
    ans = "Yes"
print(ans)

Submission status: Accepted

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

def solve(s):
    n = len(s)
    t = s[:n//2]
    u = s[::-1][:n//2]
    return "Yes" if (ok(s) and ok(t) and ok(u)) else "No"

assert solve("akasaka") == "Yes"
assert solve("level") == "No"
assert solve("atcoder") == "No"

s = input()
print(solve(s))

Submission status: Accepted

Solution code:
S = input()
S1 = S[0:(len(S)-1)//2]
S2 = S[(len(S)-1)//2+1:len(S)]

def discrimination(S):
    N = len(S)
    if N%2==0:
        return all(S[i]==S[N-1-i] for i in range(N//2))
    else:
        return all(S[i]==S[N-1-i] for i in range((N-1)//2))

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

Submission status: Accepted

Solution code:
import sys
import os
import collections

def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = sys.stdin.buffer.readline().decode().rstrip()
    p = S[:(len(S)-1)//2]
    u = S[(len(S)+2)//2:]
    print('Yes' if S == S[::-1] and p == p[::-1] and u == u[::-1] else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(x):
  n=len(x)
  for i in range(n//2):
    if x[i]!=x[n-1-i]:
      return False
  else:
    return True
s=input()
if check(s) and check(s[:len(s)//2]) and check(s[len(s)//2+1:]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
print("Yes" if all(map(lambda x: x == x[::-1], list(map(lambda s: [s, s[:len(s) // 2], s[(len(s) + 2) // 2:]], [input()]))[0])) else "No")

Submission status: Accepted

Solution code:
S = input()
result = 0
for i in range(len(S)//2):
  if S[i] != S[-1-i]:
    result += 1
A = S[:(len(S)-1)//2]
#print(A,result)
for i in range(len(A)//2):
  #print(S[i],S[-1])
  if A[i] != A[-1-i]:
    result += 1
B = S[(len(S)+2)//2:]
#print(B,result)
for i in range(len(B)//2):
  if B[i] != B[-1-i]:
    result += 1
print("Yes" if result == 0 else "No")

Submission status: Accepted

Solution code:
import sys
S = input()
N = len(S)
for i in range(N):
    if(S[i] != S[N-1-i]):
        print("No")
        sys.exit()
for i in range(int((N-1)/2)):
    if(S[i] != S[int((N-1)/2-1-i)]):
        print("No")
        sys.exit()
for i in range(int((N+1)/2-1),N):
    if(S[i] != S[N-1-i]):
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = input()

middle=len(string)//2

def isPal(string):
    return string==string[::-1]

if isPal(string):
    if isPal(string[:middle]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
S = str(input())
s = S[::-1]
if S == s:
    A = S[:len(S)//2]
    a = A[::-1]
    B = S[len(S)//2+1:]
    b = B[::-1]
    if (A == a)and(B == b):
        print('Yes')
        exit(0)
print('No')

Submission status: Accepted

Solution code:
# B
S = input()

n = len(S)
flg = True 
if S != S[::-1]:
    flg = False
s2 = S[:int((n-1)/2)]
if s2 != s2[::-1]:
    flg = False
s3 = S[int((n+3)/2):n-1]
if s3 != s3[::-1]:
    flg = False

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

Submission status: Accepted

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

if S[:(N-1)//2] == S[(N+2)//2:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    s_len = len(s)

    flag = True
    flag &= s == s[::-1]
    if not flag:
        print('No')
        return
    sh = s[0:(s_len-1)//2]
    st = s[(s_len+3)//2-1:]
    flag &= sh == sh[::-1]
    flag &= st == st[::-1]
    if not flag:
        print('No')
    else:
        print('Yes')
    return

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s == s[::-1] and s[:(len(s)//2)] == s[:len(s)//2][::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
listy=[S[i] for i in range(len(S)) ]
rev=list(reversed(listy))
bef=(len(S)-1)/2
aft=(len(S)+3)/2
jouken1=listy[0:int(bef)]
rev2=list(reversed(jouken1))
jouken2=listy[int(aft-1):len(S)]
rev3=list(reversed(jouken2))
if rev==listy and rev2==jouken1 and rev3==jouken2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
def han(s):
    return s==s[::-1]
if han(s):
    if han(s[:(n-1)//2]):
        if han(s[(n+1)//2:]):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
def checkpalin(s):
    if(s==s[::-1]):
        return True

s=input()
n=len(s)
if(checkpalin(s) and checkpalin(s[0:(n-1)//2]) and checkpalin(s[(n//2)+1:n])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if all(s[i]==s[n-i-1] for i in range(n//2)):
    if all(s[i]==s[(n-1)//2-i-1] for i in range((n-1)//4)):
        if all(s[(n+3)//2-1+i]==s[n-i-1] for i in range((n-1)//4)):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if all(s[i]==s[n-i-1] for i in range(n)):
    if all(s[i]==s[(n-1)//2-i-1] for i in range((n-1)//2)):
        if all(s[(n+3)//2-1+i]==s[n-i-1] for i in range((n-1)//2)):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

S = input()
N = len(S)

if S != S[::-1]:
    print("No")
    exit()
SF = S[0:(N-1)//2]
if SF != SF[::-1]:
    print("No")
    exit()
SL = S[(N+3)//2-1:]
if SL != SL[::-1]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()
def kaibun(s):
    return all([s[i] == s[-(i + 1)] for i in range(int(len(s) / 2))])
n = len(s)

print("Yes" if kaibun(s) & kaibun(s[0:int((n-1) / 2)]) & kaibun(s[int(n+3/2)-1:]) else "No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
p1=S[:(N-1)//2]
p2=S[(N+3)//2-1:N]

if S==S[::-1] and p1==p1[::-1] and p2==p2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

s=input()
n=(len(s))
left=s[0:(n-1)//2]
right=s[((n+3)//2-1):]

if is_kaibun(s):
  if is_kaibun(left):
    if is_kaibun(right):
      print('Yes')
    else:
      print('No')
  else:
     print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,boundary=1,search=[],replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,boundary=1,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):return [[tb//(n**bt)%n for bt in range(k)] for tb in range(n**k)]
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
def show2d(g,h,w):
    for i in range(h):show(g[i*w:i*w+w])

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

s=S_()
n=len(s)
t=s[:~-n//2]
u=s[(n+2)//2:]
if s==s[::-1] and t==t[::-1] and u==u[::-1]:
    k=0
else:
    k=1

ans=Yn[k]
print(ans)

Submission status: Accepted

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

if S != S[::-1]:
    print('No')
    exit(0)


cond_1 = S[:int((N-1)/2)]
cond_1_r = cond_1[::-1]

if cond_1 != cond_1_r:
    print('No')
    exit(0)

cond_2 = S[int((N+3)/2-1):]
cond_2_r = cond_2[::-1]

if cond_2 != cond_2_r:
    print('No')
    exit(0)

print('Yes')

Submission status: Accepted

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

if s != list(reversed(s)):
    print("No")
    exit()

seq = s[0:int(((n-1)/2))]
#print(seq)
if seq != list(reversed(seq)):
    print("No")
    exit()


seq = s[int(((n+3)/2))-1:]
#print(seq)
if seq != list(reversed(seq)):
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
def ispalindrome(s):
	#print(s)
	l=len(s)
	for i in range(l//2):
		if s[i]!=s[l-i-1]:
			return False
	return True
s=input()
l=len(s)
if ispalindrome(s) and ispalindrome(s[:l//2]) and ispalindrome(s[(l+1)//2:]):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()

left = 0
left_end = (len(S)-1)//2 -1
right = len(S)-1
right_start = (len(S)+3)//2 -1
flag = 0

for i in range((len(S)-1)//2):
	if(S[left] != S[right]) or (S[left] != S[left_end]) or (S[right_start] != S[right]):
		flag += 1
		break
	left += 1
	left_end -= 1
	right_start += 1
	right -= 1

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

Submission status: Accepted

Solution code:
s = list(input())
l = len(s)
ans = "No"
if s == s[::-1] and s[:(l-1)//2] == s[:(l-1)//2][::-1] and s[(l-1)//2+1:] == s[(l-1)//2+1:][::-1]:
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
a= input()
b = len(a)
if a!=a[::-1]:
  print("No")
elif a[:(b-1)//2]!=a[:(b-1)//2][::-1]:
  print("No")
elif a[(b+1)//2:]!=a[(b+1)//2:][::-1]:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit, stdin
S = stdin.readline().rstrip()
N = len(S)
if S == S[::-1] and S[0:(N-1)//2] == S[0:(N-1)//2][::-1] and S[(N+3)//2-1:N] == S[(N+3)//2-1:N][::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if s == s[::-1] and s1 == s1[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flag1 = (S == S[::-1])
s = S[0:(N - 1)//2]
flag2 = (s == s[::-1])
if flag1 and flag2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range((n-1+3)//4):# 切り上げ
    if not(s[i] == s[(n-1)//2-i-1] and s[(n+3)//2 + i-1] ==  s[-i-1] and s[i] == s[-i-1]):
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

#回文かどうかを判定する関数
#回文であれば1を返し、回文でなければ0を返す
def kaibunn_judge(moji):
    if moji==moji[::-1]:
        return 1
    else:
        return 0

n = len(S)
A = S[:(n-1)//2]
B = S[(n+3)//2 - 1:n]

judge = kaibunn_judge(S) + kaibunn_judge(A) + kaibunn_judge(B)

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc159/tasks/abc159_b

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

if S == S[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# 雑に考えたら前半と後半も回文になってるってことなので判定して終了
s = input()
if s != "".join(reversed(list(s))):
    print("No")
    exit()
pre = s[:len(s) // 2]
epi = s[len(s) // 2 + 1:]

if pre == "".join(reversed(pre)) and epi == "".join(reversed(epi)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

if s != s[::-1]:
  print("No")
  exit()
if s[:(len(s)-1)//2] != s[:(len(s)-1)//2][::-1]:
  print("No")
  exit()
if s[(len(s)+3)//2-1:] != s[(len(s)+3)//2-1:][::-1]:
  print("No")
  exit()
  
print("Yes")

Submission status: Accepted

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

def main():
    s = input().strip()
    len_s = len(s)

    ok = True
    for i in range(len_s//2):
        if s[i] != s[len_s-1-i]:
            ok = False
    
    for i in range((len_s//2)//2):
        if s[i] != s[(len_s//2)-1-i]:
            ok = False
    
    if ok:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()

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

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