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:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
N = len(S)

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

Submission status: Accepted

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

i = input()
a = (len(i)-1)//2 
b = (len(i)+3)//2
s1 = i[:a]
s2 = i[b-1:]
flag = False
if isPalindrome(i):
    if isPalindrome(s1):
        if isPalindrome(s2):
            flag = True
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys,math,copy,queue,itertools
sys.setrecursionlimit(10**7)
#input = sys.stdin.readline
def LI(): return [int(x) for x in input().split()]
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))
S = input()
for i in range(len(S)//2):
    if S[i] != S[len(S)-i-1]:
        print ('No')
        exit (0)

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

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
#print(S, N)
s1=S[(N-1)//2]
s3=S[(N+3)//2-1:]

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

Submission status: Accepted

Solution code:
S=input()

f1 = 0
if S == S[::-1]:
    l = len(S) //2
    sl = S[:l]
    if sl == sl[::-1]:
        ll = (len(S)+3)//2-1
        sll = S[ll:]
#         print(ll,sll)
        if sll == sll[::-1]:
            f1 = 1
            
if f1 == 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
judge1 = False
judge2 = False
n = (N - 1) // 2
for i in range(n):
    if S[i] != S[-i - 1]:
        break
    if i == n - 1:
        judge1 = True
for i in range(-(-n // 2)):
    if S[i] != S[n - i - 1]:
        break
    if S[n + 1 + i] != S[n + n - i]:
        break
    if i == -(-n // 2) - 1:
        judge2 = True
if judge1 and judge2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def func(start, end, leng):
    for i in range(leng):
        if S[start+i] != S[end-i]:
            return False
    else:
        return True

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

if func(0, N-1, N) and func(0, M-1, M) and func(M+1, N-1, M):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
first=True
second=True

for i in range((N-1)//2):
    if S[i]!=S[N-1-i]:
        first=False
if first==True:
    for j in range(N//4+1):
        if S[j]!=S[N//2-1-j]:
            second=False
if first==True and second==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Solution code:
def main():
    S = input()#|S| = odd
    N = len(S)
    T = [s for s in S]
    T1 = ''.join(reversed(T[:(N-1)//2]))
    T2 = ''.join(reversed(T[(N+3)//2-1:]))
    if S != ''.join(reversed(T)):print('No');exit()
    elif S[:(N-1)//2] != T1:print("No");exit()
    elif S[(N+3)//2-1:] != T2:print('No');exit()
    print('Yes')
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s=str(input())
a1=s[::-1]
if s!=a1:
    print("No")
    exit()
n=len(s)
a2=s[0:(n-1)//2]
#print(a2)
a21=a2[::-1]

if a2!=a21:
    print("No")
    exit()

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flag = True
if S != S[::-1]: flag = False
S1 = S[0:(N-1)//2]
if S1 != S1[::-1]: flag = False
S2 = S[(N+3)//2-1:N]
if S2 != S2[::-1]: flag = False

if flag is True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())

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

def f(s):
    flag = True
    for i,j in zip(s[:len(s)//2],s[::-1][:len(s)//2]):
        if i != j:
            flag = False
    return flag

if f(s1) and f(s2) and f(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = str(input())
n = len(s)
f = 1
for i in range(0,int((n-1)/2)):
    if s[i] != s[n-1-i]:
        f = 0
        break
for i in range(0,int((n-1)/2)):
    if s[i] != s[int((n-1)/2)-1-i]:
        f = 0
        break

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

Submission status: Accepted

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


def is_kaibun(s):
    return "".join(list(reversed(s))) == s


def is_strong_kaibun(s):
    return is_kaibun(s) and is_kaibun(s[:int(N / 2)]) and is_kaibun(s[int(N / 2) + 1:])


result = "Yes" if is_strong_kaibun(S) else "No"
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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


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

    if check_palindrome(s1) and \
        check_palindrome(s2) and \
        check_palindrome(s3):
        print("Yes")
    else:
        print("No")


submit()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    s = input()

    front = s[:len(s)//2]
    back = s[len(s)//2+1:]

    if front == back:
        if front == front[::-1] and back == back[::-1]:
            print('Yes')
            exit()

    print('No')

Submission status: Accepted

Solution code:
def Main(S):
    N = len(S)
    r_S = S[::-1]
    A = S[:(N-1)//2]
    r_A = A[::-1]
    B = S[(N+1)//2:]
    r_B = B[::-1]
    return "Yes" if S == r_S and A == r_A and B == r_B else "No"
    

def main():
    S = str(input())
    print(Main(S))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
t = len(S)
p = 0
for i in range(t//2):
    if S[i] != S[t-1-i]:
        p = 1
        break

if p == 1:
    print("No")
else:
    H = S[:(t-1)//2]
    q = len(H)
    for i in range(q // 2):
        if H[i] != H[q - 1 - i]:
            p = 1
            break
    if p == 1:
        print("No")
    else:
        K = S[(t+3)//2 - 1:]
        k = len(K)
        for i in range(k // 2):
            if K[i] != K[k - 1 - i]:
                p = 1
                break
        if p == 1:
            print("No")
        else:
            print("Yes")

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
s = input()
revs = s[::-1]
n = len(s)
s2 = s[:(n-1)//2]
revs2 = s2[::-1]
s3 = s[(n+3)//2-1:]
revs3 = s3[::-1]

# print(s == revs)
# print(s2 == revs2)
# print(s3 == revs3)
if s == revs and s2 == revs2 and s3 == revs3:
    ans = "Yes"
else:
    ans = "No"

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

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

import sys

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return

def is_panlindrome(s):
    dprint("s: %s" % (s))
    if list(s) == list(reversed(s)):
        return True
    return False

def judge(s):
    if not is_panlindrome(s):
        return False
    if not is_panlindrome(s[0:(len(s) - 1)//2]):
        return False
    if not is_panlindrome(s[(len(s) + 3) // 2 - 1: len(s)]):
        return False
    return True


def main():
    s = read(str)
    j = judge(s)
    if j:
        print("Yes")
    else:
        print("No")

    pass


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

S = input()

def isKaibun(S):
    flag = True

    for i in range(len(S)):
        if S[i] != S[len(S) - i - 1]:
            flag = False
    
    return flag

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

Submission status: Accepted

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

# isparin
for x, y in zip(S, S[::-1]):
    if x != y:
        print("No")
        exit()

L = S[: (N - 1) // 2]
R = S[-(N - 1) // 2:]


for x, y in zip(R, R[::-1]):
    if x != y:
        print("No")
        exit()
for x, y in zip(L, L[::-1]):
    if x != y:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
def main():
    s = input()
    sl = (len(s) - 1) // 2
    a = s[:sl]
    b = s[-sl:]
    if a == b:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#python3
def f(ss):
    s = list(ss)
    srv = list(reversed(s))
    if s == srv:
        return True
    else:
        return False
def main():
    s = input()
    n = len(s)
    flag = True
    if not f(s):
        flag = False
    if not f(s[:(n-1)//2]):
        flag = False
    if not f(s[((n+3)//2)-1]):
        flag = False

    if flag:
        print('Yes')
    else:
        print('No')
main()

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

for i in range((len(s)//2)//2+1):
    if s[i] != s[len(s)//2-i-1]:
        flag = True

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

Submission status: Accepted

Solution code:
import sys
s=input() 
n = len(s)
k=(n-1)//2

for i in range(n):
    if s[i]!=s[-i-1]:
        print('No')
        sys.exit()
for j in range(k):
    if s[j]!=s[k-j-1] or s[j+k+1]!=s[2*k-j]:
        print('No')
        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
import sys
S=input()
N=len(S)
S1=S[0:int((N-1)/2)]
S2=S[int((N+3)/2-1):]
#print(S1,S2)
if S1 != S2[::-1]:
  print('No')
  sys.exit()
if S1 != S1[::-1]:
  print('No')
  sys.exit()
if S2 != S2[::-1]:
  print('No')
  sys.exit()
print('Yes')

Submission status: Accepted

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

i = 0
ans = "Yes"
while(i<((n-1)//2)):
  if s[i] != s[n-1-i]:
    ans = "No"
    break
  elif s[i] != s[(n-1)//2-1-i] or s[(n+3)//2-1+i] != s[n-1-i]:
    ans = "No"
    break
  i += 1
print(ans)

Submission status: Accepted

Solution code:
S = input()
n = len(S)
S1 = S[:(n-1)//2]
S2 = S[(n+1)//2:]
flag = 0
for i in range(n):
    if S[0+i] == S[n-1-i]:
        continue
    else:
        flag = 1
for i in range((n-1)//2):
    if S1[0+i] == S1[(n-1)//2-1-i] and S2[0+i] == S2[(n-1)//2-1-i]:
        continue
    else:
        flag = 1
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
sr = s[::-1]
if n % 2 == 0:
    f = s[0:(n-1)//2 + 1]
    b = s[(n+3)//2 - 1:n]
else:
    f = s[0:(n-1)//2]
    b = s[(n+3)//2 - 1:n]

fr = f[::-1]
br = b[::-1]
flag = True
if s == sr:
    pass
else:
    flag = False
if f == fr:
    pass
else:
    flag = False
if b == br:
    pass
else:
    flag = False
    
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.q = l
        heapq.heapify(self.q)
        return

    def push(self, n):
        heapq.heappush(self.q, n)
        return

    def pop(self):
        return heapq.heappop(self.q)


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def main():
    # sys.stdin = open("sample.txt")
    def ispalindrome(str): return 1 if str == str[::-1] else 0
    S = Scanner.string()
    if not ispalindrome(S):
        print('No')
        return
    if not ispalindrome(S[:len(S)//2]):
        print('No')
        return
    if not ispalindrome(S[len(S) // 2 + 1:]):
        print('No')
        return
    print('Yes')
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().strip()
n = len(s)
def check(s):

    left = 0
    right = len(s) - 1 
    while left < right:
        if s[left] != s[right]:
            return False
        left += 1
        right -= 1
    return True
if check(s) and check(s[:(n-1)//2]) and check(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

a=S[0:(int((N-1)/2))]
b=S[(int((N+3)/2)-1):(N)]

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)
ans = 0
if S == S[::-1]:
    ans = ans + 1

tmp = S[:(N-1)//2]
if tmp == tmp[::-1]:
    ans = ans + 1

tmp = S[(N+3)//2-1:]
if tmp == tmp[::-1]:
    ans = ans + 1

print(["No", "Yes"][ans==3])

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

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()
first = is_kaibun(S)
S_s = S[0:len(S) // 2]
second = is_kaibun(S_s)
S_t = S[len(S) // 2 + 1:len(S)]
third = is_kaibun(S_t)
if first and second and third:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def checker(s):
    l = len(s)
    for i in range(l // 2):
        if (s[i] != s[-1 - i]):
            return 0
    else:
        return 1

s = input()
n = len(s)
#print(s[int((n+3)/2):])
if(checker(s) == checker(s[:int((n-1)/2)]) == checker(s[int((n+3)/2-1):]) == 1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s=input()
n=len(s)

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
n2 = (n-1)//2
flag = 1
for i in range(n2):
  if not((s[i] == s[n-i-1]) and (s[i] == s[n2-1-i]) and (s[i] == s[n2+i+1])):
    flag = 0
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
S_n_1 = S[:(N-1)//2]
S_n_2 = S[(N+3)//2-1:]
# print(S_n_1)
# print(S_n_2)

flag = 0
reverse_S = list(reversed(S))
reverse_S_n_1 = list(reversed(S_n_1))
reverse_S_n_2 = list(reversed(S_n_2))
# print(reverse_S_n_1)
# print(reverse_S_n_2)

if S == reverse_S and S_n_1 == reverse_S_n_1 and S_n_2 == reverse_S_n_2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def f(s):
	for i in range(len(s)/2):
		if s[i] != s[len(s)-i-1]:
			return False
	return True
s = raw_input()
n = len(s)
if(f(s) and f(s[:(n-1)/2]) and f(s[(n+3)/2 - 1:]) ):
	print "Yes"
else:
	print "No"

Submission status: Accepted

Solution code:



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


S = input()
i = (len(S) - 1) // 2
j = (len(S) + 3) // 2
if check_kaibun(S) and check_kaibun(S[:i]) and check_kaibun(S[j - 1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
s2 = s[::-1]
# print(s2)

if s != s2:
    print('No')
    exit(0)

partial_s = s[0:((len(s) - 1) // 2)]
# print(partial_s)
partial_s2 = partial_s[::-1]
if partial_s != partial_s2:
    print('No')
    exit(0)

partial_ss = s[((len(s) + 3) // 2) - 1:]
# print(partial_s2)
partial_ss2 = partial_s[::-1]
if partial_ss != partial_ss2:
    print('No')
    exit(0)
print('Yes')

Submission status: Accepted

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


def rli():
    return list(map(int, input().split()))


def check2(s):
    l = len(s) // 2
    if len(s) % 2 == 0:
        if s[:l] != s[:l-1:-1]:
            return False
    else:
        if s[:l] != s[:l:-1]:
            return False
    return True


def check(s):
    l = len(s) // 2
    if s[:l] != s[:l:-1]:
        return False
    if check2(s[:l]) and check2(s[l+1:]):
        return  True
    return False


def main():
    s = input()
    if check(s):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

def func(ass):
    for i in range(len(ass)//2):
        if ass[i] != ass[-(i+1)]:
            print('No')
            exit()

func(s)
func(s[:len(s)//2])
func(s[len(s)//2+len(s)%2:])

print('Yes')

Submission status: Accepted

Solution code:
S = input()

N = len(S)

def check(SS):
    L = len(SS)
    f = 0
    for i in range(L):
        if SS[i] != SS[L - i - 1]:
            f = 1
    if f == 1:
        return False
    else:
        return True


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

Submission status: Accepted

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# abc159/abc159_b
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    N = len(S)
    if is_kaibun(S) and is_kaibun(S[:(N-1)//2]) and is_kaibun(S[(N+3)//2-1:]):
        print('Yes')
    else:
        print('No')
    return

def is_kaibun(S):
    return S == ''.join(reversed(S))

main()

Submission status: Accepted

Solution code:

s = input()

rev_s = s[::-1]
half_s = s[0:len(s)//2]
rev_half_s = half_s[::-1]
third_s = s[(len(s)+3)//2-1:]
rev_third_s = third_s[::-1]

if (s == rev_s) and (half_s == rev_half_s) and (third_s == rev_third_s):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = [s for s in input()]
l = len(s)//2

s_1 = s[:l]
s_2 = s[l+1:]

if s!=s[::-1]:
  print('No')
elif s_1!=s_1[::-1]:
  print('No')
elif s_2!=s_2[::-1]:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
import sys

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

s = input()
n = len(s)

if not hantei(s):
  print('No')
  sys.exit(0)
    
if not hantei(s[0:(n-1)//2]):
  print('No')
  sys.exit(0)
  
if not hantei(s[(n+1)//2 : n]):
  print('No')
  sys.exit(0)

print('Yes')

Submission status: Accepted

Solution code:
s = input()

s_len = len(s)
s_1 = s[:(s_len-1)//2]
s_2 = s[(s_len+3)//2-1:]
test_1 = s
test_2 = s[::-1]

is_ok = True

if not test_1==test_2:
    is_ok = False

if not s_1==s_1[::-1]:
    is_ok = False

if not s_2==s_2[::-1]:
    is_ok = False

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

Submission status: Accepted

Solution code:
s = list(input())

#sは回文
for i in range(len(s)//2):
    if s[i] != s[-i-1]:
        print('No')
        exit()

#Sの1文字目から(N−1)/2 文字目まで(両端含む)からなる文字列は回文
s_begin = s[:len(s)//2:]
for j in range(len(s_begin)//2):
    if s_begin[j] != s_begin[-j-1]:
        print('No')
        exit()

#Sの(N+3)/2文字目からN文字目まで(両端含む)からなる文字列は回文
s_end = s[len(s)//2+1::]
for k in range(len(s_end)//2):
    if s_end[k] != s_end[-k-1]:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

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

pre = S[0:int((N-1)/2)]
post = S[int((N+3)/2)-1:N]

if pre == post:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

f = 'Yes'
for i in range(int((l-1)/2)):
    if s[i] != s[l-i-1]:
        f = 'No'
for i in range(int(((l-1)/2)//2)):
    if s[i] != s[l-i-int((l-1)/2+1)-1]:
        f = 'No'




print(f)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
left=S[0:(len(S)-1)//2]
right=S[(len(S)-1)//2+1:]

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



def yes():
    print("Yes")
    exit()
def No():
    print("No")
    exit()
if not left ==right:
    No()
else:
    if is_kaibun(left):
        yes()
    else:
        No()

Submission status: Accepted

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

def check_kaibun(s):
    if s == s[::-1]:
        return 1
    else:
        return -1

if check_kaibun(s) == -1:
    print('No')
    exit(0)

mae = s[0: int(l/2)]
ushiro = s[int(l/2)+1:]

if mae == ushiro:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(s):
    n = len(s)
    if n==1:
        return True
    if n==2:
        return s[0]==s[1]
    if n==3:
        return s[0]==s[2]
    if n%2==0:
        s1 = s[:n//2]
        s2 = s[n//2:]
        return s1==s2[::-1]
    else:
        s1 = s[:(n-1)//2]
        s2 = s[(n+1)//2:]
        return s1==s2[::-1]

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s_back = s[::-1]
s_2 = s[:(n-1)//2]
s_2back = s_2[::-1]
s_3 = s[(n+2)//2:]
s_3back = s_3[::-1]

if s == s_back and s_2 == s_2back and s_3 == s_3back:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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) and is_kaibun(S[:int((N - 1) / 2)]) and is_kaibun(S[int((N + 3) / 2 - 1):]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

s_for = s[:(n-1) // 2]
s_back = s[(n+3) // 2 - 1:]

if ispalindrome(s) and ispalindrome(s_for) and ispalindrome(s_back):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
ans = "Yes"
s = input()
n = len(s)
half = n//2
def iskaibun(v):
    vh = len(v)//2
    for i in range(vh):
        if v[i] != v[-i-1]:
            return True
    return False#kaibun de aru

if iskaibun(s) or iskaibun(s[0:half]) or iskaibun(s[-half:]):
    ans = 'No'
print(ans)

Submission status: Accepted

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

s1 = s[:n // 2]
s2 = s[n // 2 + 1:]

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
zen=(N-1)//2
kou=(N+3)//2
T=S[::-1]

T2=S[:zen]
T2=T2[::-1]

T3=S[kou-1:]
T3=T3[::-1]

#print(T,T2,T3)
#print(S,S[:zen],S[kou-1:])
if T==S:
    if S[:zen]==T2:
        if S[kou-1:]==T3:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

def kaibun(s, n):
    if n % 2 == 1:
        front = s[:n//2+1]
        back = s[n//2:]
    else:
        front = s[:n//2]
        back = s[n//2:]

    return front == "".join(reversed(back))


if kaibun(S, N) and kaibun(S[:(N-1)//2], (N-1)//2) and kaibun(S[(N+3)//2-1:], (N+3)//2-2):
    print("Yes")
else:
    print("No")