Problem:


Score : 200 points

Problem Statement

A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:

S is a palindrome.

Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.

The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.

Determine whether S is a strong palindrome.

Constraints

S consists of lowercase English letters.

The length of S is an odd number between 3 and 99 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

If S is a strong palindrome, print Yes;
otherwise, print No.

Sample Input 1

akasaka

Sample Output 1

Yes

S is akasaka.

The string formed by the 1-st through the 3-rd characters is aka.

The string formed by the 5-th through the 7-th characters is aka.
All of these are palindromes, so S is a strong palindrome.

Sample Input 2

level

Sample Output 2

No

Sample Input 3

atcoder

Sample Output 3

No



Sample input:
akasaka


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    len_s = len(S)
    flag = False
    if S == S[::-1]:
        if S[len_s // 2] == S[len_s // 2:-1:-1]:
            if S[len_s // 2:] == S[-1:len_s // 2:-1]:
                flag = True
    if flag:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
sign = 0
limit_1 = int((n-1)//2)

for i in range(limit_1):
  if not (s[i] == s[-i-1]):
    sign = 1

judge = limit_1%2
if judge == 0:
  limit_2 = int(limit_1//2)
elif judge == 1:
  limit_2 = int((limit_1-1)//2)

for i in range(limit_2):
  if not (s[i] == s[-i-limit_1]):
    sign = 1
    
if sign == 0:
  ans = "Yes"
elif sign == 1:
  ans = "No"
  
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

ans = 0

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

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

if s1 == s3:
    ans += 1

if s2 == s4:
    ans += 1

if n >= 99:
    ans -= 1

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

Submission status: Wrong Answer

Solution code:
data = input()

length = len(data)

half = int((length-1)/2)

if data[:half] == data[half+1:]:
    data_2 = data[:half]
    length = len(data_2)
    half = int((length-1)/2)
    if data_2[:half] == data_2[half+1:]:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions
import decimal
from collections import deque

s=str(input())
a=s[:(len(s)-1)//2]
# print(a)
if(a!=a[::-1]):
    print("No")
    exit(0)
b=s[(len(s)+3)//2-1:]
# print(b)akasaka
if(b!=b[::-1]):
    print("No")
    exit(0)

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def is_p(s):
    n = len(s)
    if s[:n//2] == s[n//2+1:]:
        return True
    return False

def main():
    s = input()
    n = len(s)

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if L > 5:
    if S[0] == S[L-1] and S[1] == S[L-2] and S[2] == S[L-3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

Solution code:
s = input()

def f(s):
    if s == s[::-1]:
        return True
    return False
n = len(s)
o = (n-1)//2
e = (n+3)//2 - 1
if n == 3 and f(s[1:]):
    print("Yes")
elif n == 3:
    print("No")
elif f(s[:o]) and f(s[e:]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
def isPalindrome(S, i, j):
    i = int(i)
    j = int(j)
    while S[i] == S[j]:
        i+=1
        j-=1
        if i == j:
            return True
        elif i > j:
            return False

if isPalindrome(S, 0, N-1) and isPalindrome(S, 0, (N-1)/2-1) and isPalindrome(S, (N+3)/2-1, N-1):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from fractions import gcd
# from datetime import date, timedelta
# from heapq import *
import heapq
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

import random
def main():
    s = list(input())
    n = len(s)
    a = s[:(n - 1) // 2]
    b = s[(n + 3) // 2-1:]
    
    for i in range(len(a) // 2):
        if (a[i] != a[len(a) - 1 - i]):
            print("No")
            exit()


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    left_num = len(left)
    right_num = len(right)
    left_l, left_r = left[:(left_num-1)//2], left[(left_num+1)//2:][::-1]
    right_l, right_r = right[:(right_num-1)//2], right[(right_num+1)//2:][::-1]

    if left_l == left_r and right_l == right_r:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
import math
if s[:n//2]!=s[n//2+1:][::-1]:
    print("No1")
    exit()
left = s[:n//2]
right = s[n//2+1:]
n = len(left)
if left[:n//2]!=left[math.ceil(n/2):][::-1]:
    print("No2")
    exit()
if right[:n//2]!=right[math.ceil(n/2):][::-1]:
    print("No3")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

N=len(s)

s1=s[:(N-1)//2]
s2=s[(N+3)//2-1:]

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

Submission status: Wrong Answer

Solution code:
def check_kaibun(s):
    center_idx = len(s) // 2
    if s[:center_idx] == s[center_idx + 1 :][::-1]:
        return True
    else:
        return False


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
  s = input()
  n = len(s)
  first = s[:(n-1)//2]
  last = s[(n+2)//2:]
  if first != last[::-1]:
    print('No')
    exit(0)
  print('Yes')
  
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

import math
import fractions
import collections
from functools import reduce
main()

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

index1 = (n-1)//2
index2 = (n+3)//2

flag = True

if s == s[::-1]:
    if s[:index1] == s[:index1][::-1]:
        if s[index2+1:] == s[index2+1:][::-1]:
            print('Yes')
            flag = False
        
if flag:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

s = [c for c in s]

left = s[:len(s)//2]
right = s[len(s)//2+1:]

def check(s):
    left = []
    right = []

    while len(s)>1:
        left.append(s.pop(0))
        right.append(s.pop())
    
    if left==right:
        return True
    else:
        return False

if check(left)==True and check(right)==True and left==right:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def is_palindrome(s):
    h = len(s) // 2
    if s[:h] == s[len(s):h:-1]:
        return True

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

Submission status: Wrong Answer

Solution code:
#from scipy.special import comb
#from math import factorial

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

if S == S[::-1]:
  if S1 == S1[::-1]:
    if S2 == S2[::-1]:
      print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()

def check(s):
    if len(s) % 2 == 0:
        before = s[:len(s) // 2]
        after = s[len(s) // 2:]

        
    else:
        before = s[: len(s) // 2]
        after  = s[((len(s)// 2) + 1):]

    if before == after:
        return True
    else:
        return False

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

Submission status: Wrong Answer

Solution code:
a = input()

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

Submission status: Wrong Answer

Solution code:
s=input()
n=int((len(s)-1)*0.5)
ans="Yes"
for i in range(n):
  if (s[i]==s[n-1-i]) & (s[n+1+i]==s[n*2-i]):
    continue
  else:
    ans="No"
    break

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
def test(s):
    l = len(s)
    sub = l//2
    return s[:sub][::-1] == s[-1*sub:]
if test(s[:(l-1)//2]) and test(s):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)//2):
    if s[i] == s[-i-1]:
        continue
    else:
        print("No")
        exit()
        
s_f = s[:len(s)//2]
s_b = s[len(s)//2 + 1:]

if len(s_f) & 2 == 0:
    print("No")
    exit()

for i in range(len(s_f)//2):
    if s_f[i] == s_f[-i-1]:
        pass
    else:
        print("No")
        exit()
    
    if s_b[i] == s_b[-i-1]:
        pass
    else:
        print("No")
        exit()
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
#


def main():
    s = input()
    n = len(s)
    mae_last = (n - 1) // 2 - 1
    usiro_first = (n + 3) // 2 - 1
    i = 0
    while i < mae_last:
        if s[i] != s[mae_last]:
            print("No")
            return
        i += 1
        mae_last -= 1
    i = n - 1
    while i > usiro_first:
        if s[usiro_first] != s[i]:
            print("No")
            return
        i -= 1
        usiro_first += 1
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    print("kaibun: ", s)
    for i in range(round((len(s) / 2))):
        if s[i] == s[len(s) - i - 1]:
            continue
        else:
            return False
    return True


s = str(input())
n = len(s)
if kaibun(s):
    if kaibun(s[0:round((n - 1) / 2)]):
        if kaibun(s[round((n + 3) / 2) - 1:]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

s = list(s)

ans = True

fs = 0
sl = -1
fl = (len(s) - 1) // 2 - 1
ss = (len(s) + 3) // 2 - 1
for i in range((fl+1) // 2):
    if s[fs+i] == s[fl-i] and s[fl-i] == s[ss+i] and s[ss+i] == s[sl-i]:
        pass
    else:
        ans = False
        break

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

Submission status: Wrong Answer

Solution code:
s = str(input())

x = 0
nag = len(s)
y = (nag-1) //2

for i in range(y//2):
    if s[i] != s[y - 1 - i] or s[y + 1 + i] != s[nag - 1 - i] or s[i] != s[y + 1 + i]:
        x = 1
        break

if x == 0:
    print("Yes")
elif x == 1:
    print("No")

Submission status: Wrong Answer

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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


def main():
    S = input().rstrip()

    N = len(S)

    isKaibunn = kaibunn(S)

    if isKaibunn:
        T = S[0:(N-1)//2-1]
        isKaibunn = kaibunn(T)
        if isKaibunn:
            T = S[(N+3)//2-1:N-1]
            isKaibunn = kaibunn(T)

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


main()

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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


b=int((len(s)-1)/2)
c=int((len(s)+3)/2)
mae=s[:b]
ato=s[c:]
if kaibun(s) and kaibun(mae) and kaibun(ato) :
  print ('Yes')
else :
  print('No')

Submission status: Wrong Answer

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

print(S1[::-1] == S[:(N-1)/2] and S2[::-1] == S[(N+1)/2:])

Submission status: Wrong Answer

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

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


for i in range(int((N-1)/2)):
  if S1[i] != S1[len(S1)-i-1]:
    flag = 0
  if S2[i] != S2[len(S2)-i-1]:
    flag = 0
    
if flag == 1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

def check(x):
    if len(x) == 1:
        return True
    else:
        # weak check
        if len(x) % 2 == 0:  # each substring should not be even
            return False
        ind = (len(x) + 1) // 2
        left = x[:ind-1]
        right = x[ind:][::-1]
        if left != right:
            return False
        else:
            if check(left) and check(right):
                return True
            else:
                return False

if check(S):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = "No"
if (x+1)%4 == 0:
    if a == b:
        if c == d:
            if a == b:
                ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
def check_kaibun(s):
    center_idx = len(s) // 2
    if s[:center_idx] == s[center_idx + 1 :][::-1]:
        return True
    else:
        return False


S = input()
idx = len(S) // 2
print(S, S[:idx], S[idx + 1 :])
if check_kaibun(S) and check_kaibun(S[:idx]) and check_kaibun(S[idx + 1 :]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
def isKaibun(a, b):
    return a == b[::-1]


S = input()
ans = True
f = S[:len(S)//2]
l = S[len(S)//2+1:]
f_f = S[:len(S)//2//2]
f_l = S[len(S)//2//2+1:len(S)//2]
l_f = S[len(S)//2+1:len(S)//2+1+len(S)//2//2]
l_l = S[len(S)//2+1+len(S)//2//2+1:]

if isKaibun(f, l) and isKaibun(f_f, f_l) and isKaibun(l_f, l_l):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

c = s[0:a]
d = c[::-1]
e = s[b-1:n]
f = e[::-1]

if c==d and e==f:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if n >= 5:
    a = s[0:(n-1)//2]
    b = s[(n+3)//2:-1]
    if a == a[::-1] and b == b[::-1]:
        print("Yes")
    else:
        print("No")
else:
    if s == s[::-1]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions
import decimal
from collections import deque

s=str(input())
a=s[:(len(s)-1)//2]
# print(a)
if(a!=a[::-1]):
    print("No")
    exit(0)
b=s[(len(s)+2)//2:]
# print(b)
if(b!=b[::-1]):
    print("No")
    exit(0)

print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if n == 3:
    print("Yes")
elif n == 5:
    print("No")
elif (n//2)%2 == 0:
    print("No")
else:
    l, r = s[:(n-1)//2], s[(n+1)//2:]
    m = len(l)
    ll, lr = l[:(m-1)//2], l[(m+1)//2:]
    rl, rr = l[:(m-1)//2], l[(m+1)//2:]
    if ll == lr and rl == rr:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

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

Sl=S[:N//2]
for i in range(len(Sl)//2):
    if Sl[i]!=Sl[-i]:
        print('No')
        exit()

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

print('Yes')

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    print("kaibun: ", s)
    for i in range(round((len(s) / 2))):
        if s[i] == s[len(s) - i - 1]:
            continue
        else:
            return False
    return True


s = str(input())
n = len(s)

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

Submission status: Wrong Answer

Solution code:
s= input()
z=len(s)//2
flag=0
sd=s[0:z-1]
if sd==s[z+1:len(s)-1]:
    if sd==sd[::-1]:
        flag=1
if flag==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if c1(S) and c1(SS) and c1(SSS):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import math
def A():
    N, M = map(int, input().split())
    if N == 1 == M:
        print(0)
        return
    ans = 0
    if N > 1:
        ans += math.factorial(N)//(2*(math.factorial(N-2)))
    if M > 1:
        ans += math.factorial(M)//(2*(math.factorial(M-2)))
    print(ans)

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

Submission status: Wrong Answer

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

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

N2 = len(a)
#print(a, b, N)

if a[0:(N2 - 1) // 2] == a[(N2 + 3) // 2 - 1:] and b[0:(N2 - 1) // 2] == b[(N2 + 3) // 2 - 1:]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

n = len(S)

def check_is_kaibun(s):
    is_kaibun = False
    for i in range(len(s)//2):
        is_kaibun = s[i] == s[len(s)-1-i]
    return is_kaibun
  
if check_is_kaibun(S) == check_is_kaibun(S[:(n-1)//2]) == check_is_kaibun(S[(n+1)//2:]) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

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

S = input().strip()
if len(S)%2 == 0:
    print('No')
else:
    if not check_p(S[:(len(S) - 1)//2]):
        print('No')
    elif not check_p(S[((len(S) + 3)//2) - 1:]):
        print('No')
    else:
        print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
#import copy

#import numpy as np

s=input().strip()
n=len(s)
#print(s[:n//2],s[n//2+1:])
if s[:n//2]==s[n//2+1:]:
    #print("q")
    if (n//2)%2==0:
        #print("a")
        #print(s[:n//4], s[n//4:n//2] ,s[n//2+1:n//2+n//4+1], s[n//2+1+n//4:])
        if s[:n//4] == s[n//4:n//2] and s[n//2+1:n//2+n//4+1]==s[n//2+1+n//4:]:
            print("Yes")
        else:
            print("No")
    else:
        #print("b", s[:n//4], s[n//4:n//2],s[n//2+1:n//2+1+n//4],s[n//2+1+n//4:])
        if s[:n//4] == s[n//4+1:n//2] and s[n//2+1:n//2+1+n//4] == s[n//2+1+n//4+1:]:
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
inp = input()

N = len(inp)

s1 = inp[0:(N-1)//2]
s2 = inp[(N+1)//2:N]

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

Submission status: Wrong Answer

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

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

ss = S[:(N - 1) // 2]
if ss[::-1] != ss:
    print("No")
    exit()

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

print("Yes")

Submission status: Wrong Answer

Solution code:
# class Solution:
#     def solve(self, a, b, c, s):
#         return str(a + b + c) + " " + s


def main():
    inp = lambda: [int(x) for x in input().split()]
    s = input()
    n = (len(s)) // 2
    is_paliny = lambda a: a == a[::-1]
    ans = "YES" if is_paliny(s) and is_paliny(s[:n]) else "NO"
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())
t = s[::-1]
if(s != t):
    print("No")
    exit
c = ""
for i in range((len(s)-1)//2):
    c += s[i]
e = c[::-1]
if(e != c):
    print("No")
    exit()
r = ""
for i in range(((len(s)+3)//2)-1,len(s),1):
    r += s[i]
y = r[::-1]
if(r != y):
    print("No")
    exit()
print("Yes")
"""
print(s,t)
print(e,c)
print(r,y)
"""

Submission status: Wrong Answer

Solution code:
def is_palindrome(s):
    if len(s) < 1:
        return True
    elif s != s[::-1]:
        return False

    return is_palindrome(s[:len(s) // 2]) and is_palindrome(s[len(s) // 2 + (1 if len(s) % 2 != 0 else 0):])


if __name__ == '__main__':
    s = input()

    print("Yes" if is_palindrome(s) else "No")

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    length = len(S)
    S1 = S[0:int((length-1)/2)]
    S2 = S[int((length+3)/2-1):length]
    ans = "Yes"
    for i in range(len(S1)):
        if S1[i] != S1[-i-1]:
            ans = "No"
            break
    for i in range(len(S2)):
        if S2[i] != S2[-i-1]:
            ans = "No"
            break
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = input()

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

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

print(main(s))

Submission status: Wrong Answer

Solution code:
S = input()
N=len(S) # 奇数
S1 = S[0:(N-1)//2]
S2 = S[(N+3)//2-1:]
S1_inv = S1[::-1]
S2_inv = S2[::-1]
if S1 == S1_inv and S2 == S2_inv:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

def cond():
    p1 = ((len(s) - 1)//2)
    p2 = (len(s) + 3)//2 - 1
    t1 = s[:p1]
    t2 = s[p2:]
    return t1 == ''.join(reversed(t1)) and t2 == ''.join(reversed(t2))

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

Submission status: Wrong Answer

Solution code:
S = input()
reS = S[::-1]
if S != reS:
    print("No")
    exit()

minS = S[:3]
minreS = minS[::-1]
maxS = reS[:3]
maxreS = maxS[::-1]
if minS == minreS and maxS == maxreS:
    print("Yes")

else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
n=len(S)
flag=0
S1=S[0:(n-1)//2]
S2=S[(n+2)//2:]
if S1==S1[::-1] and S2==S2[::-1]:
    pass
else:
    flag=1
print('Yes' if flag==0 else 'No')

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
def isPalindrome(S, i, j):
    i = int(i)
    j = int(j)
    while S[i] == S[j]:
        i+=1
        j-=1
        if i == j:
            return True
        elif i > j:
            return False

if isPalindrome(S, 0, (N-1)/2-1) and isPalindrome(S, (N+3)/2-1, N-1):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

l_1 = letter[:int((N-1)/2)]
l_2 = letter[int((N+3)/2-1):]

if(l_1 == l_1[::-1] and l_2 == l_2[::-1]):
    ans = "Yes"
else:
    ans = "No"
# print(l_1)
# print(l_2)

print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
n=len(S)
if  S[0:int((n-1)/2)]== ''.join(list(reversed(S[0:int((n-1)/2)]))) and S[int((n+1)/2):n]==''.join(list(reversed(S[int((n+1)/2):(n)]))):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
l = len(s)
c = (l-1)//2

count = 0
for i in range(0,c-1):
  if s[i] == s[l-i-1]:
    count = count + 1
    
if count == c-1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
S = str(input())
temp = len(S)
if S == S[::-1]:
    tempi =S[0:(temp-1)//2]
    #print(tempi)
    if tempi == tempi[::-1]:
        tempi2 = S[(temp+3)//2+1:]
        #print(tempi2)
        if tempi2 == tempi2[::-1]:
            print('Yes', end='')
        else:
            print('No', end='')
    else:
        print('No', end='')
else:
    print('No', end='')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
s = input().strip()

def is_kaibun(ss):
    return ss[: len(ss) // 2] == ss[len(ss) // 2 + 1:][:: -1]

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def is_p(s):
    n = len(s)
    if s[:n//2] == s[n//2+1:]:
        return True
    return False

def main():
    s = input()
    n = len(s)

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

    return

if __name__ == '__main__':
    main()