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:
given = input()
n = len(given)
left, rite = given[:n//2], given[n//2+1:]
if given == given[::-1]:
    if left == left[::-1]:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
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 MI() : return map(int, input().split())
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)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

N = len(S)

if N >= 7:
    if S[0 : int((N - 1)/2)] == S[int((N + 1)/2) : int(N)]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

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

s_list = list(s)
r_list = list(s)
r_list.reverse()

first_s_list = s_list[0:(n - 1) // 2]
first_r_list = list(reversed(first_s_list))

last_s_list = s_list[(n + 2) // 2:n]
last_r_list = list(reversed(last_s_list))

if s_list == r_list and first_s_list == first_r_list and last_s_list == last_r_list:
    print('Yes')
else:
    print('No')


print(first_s_list, first_r_list)
print(last_s_list, last_r_list)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
word = input()
N = int(len(word))
#1つ目
number1 = int((N-1)/2)
word1 = word[:number1]
count1 = 0
for i in range(int((number1 - 1)/2)):
  if word[i] == word[number1 - 1 - i]:
    count1 += 1
#2つ目
number2 = int((N-1)/2)
word2 = word[-number2+1:]
count2 = 0
for j in range(int((number2 - 1)/2)):
  if word[number2+1+j] == word[N-1-j]:
    count2 += 1
if count1+count2 == (number1 - 1):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = str(input())

ans = 0

def kaibun(tex):
  n = len(tex)
  before = tex[0:int((n-1)/2)]
  after = tex[int((n+3)/2-1):]
  if before == before[::-1] and after == after[::-1]:
    return 1
  else:
    return 0

ans += kaibun(s)

before = s[0:int((len(s)-1)/2)]
after = s[int((len(s)+3)/2-1):]

if ans == 1 and after == after[::-1] and before == before[::-1]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = input()
s1 = s[::-1]
l=len(s)

check = 0
if(s==s1):
    if(s[0:int((l-1)/2)] == s1[0:int((l-1)/2)]):
        if(s[int((l+3)/2)-1:l] == s[int((l+3)/2)-1:l]):
            print("Yes")
            check =1
if(check ==0):
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
import math

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

S = input()
N = len(S)

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

if is_anagram(cond1) and is_anagram(cond2):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)
l = int((n-1)/2)  # n=3:1, n=5:2, n=7:3, n=9:4
b = int((n+3)/2)  # n=3:3, n=5:4, n=7:5, n=9:6

for i in range(l - int(l/2)):
    if s[i] == s[l-1-i]:
        result = True
    else:
        result = False
        break

for i in range(n-b - int((n-b)/2)):
    if s[b-1+i] == s[n-1-i]:
        result = True
    else:
        result = False
        break

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

Submission status: Wrong Answer

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

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)
c = a[::-1]
d = b[::-1]

if N2 % 2 == 0:
    if a[0:N2//2] == c[0:N2//2] and b[0:N2//2] == d[0:N2//2]:
        print('Yes')
    else:
        print('No')

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def judge_kaibun(S):
    n = len(S)
    center = n//2
    return S[:center] == S[-center:][::-1]


if N == 3:
    if S[0] == S[2]:
        print("Yes")
    else:
        print("No")
    exit()

pre_judge = judge_kaibun(S[:(N-1)//2])
pos_judge = judge_kaibun(S[-(N-1)//2:])

if pre_judge and pos_judge:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
j1 = S[:int((N-1)/2)] == S[int((N-1)/2+1):]

j2_str = S[0:int((N-1)/2)]
l2 = len(j2_str)
if l2%2==0:
    j2 = j2_str[:int((l2)/2)] == j2_str[int((l2)/2+1):]
else :
    j2 = j2_str[:int((l2-1)/2)] == j2_str[int((l2-1)/2+1):]

j3_str = S[int((N+3)/2-1):]
l3 = len(j3_str)
if l3%2==0:
    j3 = j3_str[:int((l3)/2)] == j3_str[int((l3)/2+1):]
else :
    j3 = j3_str[:int((l3-1)/2)] == j3_str[int((l3-1)/2+1):]

if N>=7:
    if j1&j2&j3:
        ans = 'Yes'
    else :
        ans = 'No'
elif N==5:
    if S[0]==S[1]==S[3]==S[4]:
        ans='Yes'
    else :
        ans='No'
else :
    if S[0]==S[2]:
        ans = 'Yes'
    else :
        ans = 'No'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
str = input()
list_str = list(str)

pal = "Yes"

for i in range((len(list_str) // 2) - 1):
  if list_str[i] != list_str[len(list_str) - 1 - i]:
    pal = "No"
    break

str_half = []
    
for i in range(len(list_str) - 1 // 2):
  str_half.append(list_str[i])

for i in range((len(str_half) // 2) - 1):
  if str_half[i] != list_str[len(str_half) - 1 - i]:
    pal = "No"
    break

str_any = []

for i in range((len(list_str) + 3 // 2) - 1, len(list_str) - 1):
  str_any.append(list_str[i])

for i in range((len(str_any) // 2) - 1):
  if str_any[i] != list_str[len(str_any) - 1 - i]:
    pal = "No"
    break

print(pal)

Submission status: Wrong Answer

Solution code:

import math

s = input()
list = list(s)


num = math.floor(len(s)/2)
count = 0


if len(s) == 3:
    if list[0] == list[2]:
        print("Yes")
    else:
        print("No")
else:
    for i in range(num - 1):
        if list[i] == list[len(s) - 1 - i]:
            count += 1
        else:
            print("No")
            break

if len(s) == 3:
    None
else:
    if count == num - 1:
        print("Yes")
    else:
        None

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


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)
l=int((N-1)/2 -1)
#r = int((N+3)/2 +1)
r=l+2
print(s,l,r)
if is_kaibun(s) and is_kaibun(s[:(l+1)]) and is_kaibun(s[r:]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

pre = list(s[0:int((n-1)/2)])
rear = list(s[int((n+3)/2-1):int(n)])

for i in range(len(pre)):
    if pre[i-1] != pre[-i]:
        print('No')
        exit()

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

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    n = len(s)
    if n%2==0:
        S1 = s[:n//2]
        S2 = s[n//2:]
        for i in range(n//2):
            if S1[i]!=S2[i]:
                return False
        return True
    else:
        S1 = s[:n//2]
        S2 = s[n//2+1:]
        for i in range(n//2-1):
            if S1[i]!=S2[i]:
                return False
        return True
        
S = input()

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

s_b = kaibun(S)
s1_b = kaibun(s1)
s2_b = kaibun(s2)

if (s_b and s1_b and s2_b):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

point1 = int((n-1)/2)
point2 = int((n+3)/2)

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

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

Submission status: Wrong Answer

Solution code:
import math
S = input()
N_s = int((len(S)-1)/2)-1
N_l = int((len(S)+3)/2)

num = N_s
flg = True
num_std = len(S)-1
for k in range(len(S)):
    if S[k] != S[num_std] and k < num_std:
        flg = False
        print("No")
        break
    if k > num_std:
        break
    num_std -= 1
if flg:
    for i in  range(N_s):
        if(S[i] != S[num]):
            if(num > i):
                print("No")
                break
        if(num == i or num < i):
            num2 = len(S)-1
            for j in range(N_l-1,len(S),1):
                if(S[j] != S[num2]):
                    if(num2 > j):
                        print("No_1")
                        break
                if(num2 == j or num < j):
                    print("Yes")
                    break
                num2 -= 1
        num -= 1

Submission status: Wrong Answer

Solution code:
S = input()
s = list(S)
def is_strong_palindrome(strings):
    a = len(strings)
    b = (len(strings) - 1) // 2
    c = (len(strings) + 3) // 2
    for i in range(b // 2):
        if strings[i] != strings[(b-i-1)]:
            return False
    for j in range((a-c+1) // 2):
        if strings[c+j-1] != strings[a-j-1]:
            return False
    return True
if is_strong_palindrome(s) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

a = int((N-1)/2)-1
b = int((N+3)/2)-1
flag_a = 1
flag_b = 1

A = int((a+1)//2)
B = int((b+N)//2)
#print(A)
#print(B)

s1 = S[:a+1]
s2 = S[b:]

"""""""""
for i in range(0, A):
    if S[i] != S[a-i]:
        flag_a = 0

j=1

for i in range(b, B):
    if S[b] != S[N-j]:
        flag_b =0
    j += 1

if flag_a == 1 and flag_b == 1:
    print('Yes')
else:
    print('No')
    
"""""

#print(flag_a)
#print(flag_b)

#print(s1)
#print(s2)


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

else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)
l = int((n-1)/2)  # n=3:1, n=5:2, n=7:3, n=9:4
b = int((n+3)/2)  # n=3:3, n=5:4, n=7:5, n=9:6

for i in range(l - int(l/2)):
    if s[i] == s[l-1-i]:
        result = True
    else:
        result = False
        break

for i in range(n-b+1 - int((n-b+1)/2)):
    if s[b-1+i] == s[n-1-i]:
        result = True
    else:
        result = False
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
word = input()
N = int(len(word))
#1つ目
number1 = int((N-1)/2)
word1 = word[:number1]
count1 = 0
for i in range(int((number1 - 1)/2)):
  if word[i] == word[number1 - 1 - i]:
    count1 += 1
#2つ目
number2 = int((N-1)/2)
word2 = word[-number2+1:]
count2 = 0
for j in range(int((number2 - 1)/2)):
  if word[number2+1+j] == word[N-1-j]:
    count2 += 1
if count1+count2 == (number1 - 1):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
raw_input = input()
S_list = list(raw_input)
N = len(S_list)

def judge_par(s_list,n):
    n_half = (n-1) // 2
    s_top = s_list[:n_half]
    s_bottom = s_list[(n_half+1):]
    s_bottom.reverse()    
    if s_top == s_bottom:
        return True
    else:
        return False
    
if judge_par(S_list,N) == True:
    N_half = (N-1) // 2
    S_top = S_list[:N_half]
    S_bottom = S_list[(N_half+1):]
    if N_half <3:
        print("No")
    elif judge_par(S_top,N_half) == True and judge_par(S_bottom,N_half) == True:
        print ("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)

s = input()
n = len(s)
a = n-1
b = n-3
en = a/2
sta = b/2
bb = n - int(sta) + 1
ans = 0

if en % 2 == 0:
    mid = int(en)/2
else:
    aa = int(en)-1
    mid = aa/2

if bb % 2 == 0:
    mid2 = bb/2
else:
    cc = bb-1
    mid2 = cc/2

for v in range(int(mid)):
    if s[v] == s[int(en) - v - 1]:
        ans += 1
for k in range(int(mid2)):
    if s[int(sta) + k - 2] == s[n - k - 1]:
        ans += 1

if ans == int(mid) + int(mid2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import copy

S = input()
flag_fail = 0
N = len(S)

while N != 1:
  S_temp = copy.copy(S)
  N = len(S)
  K = N // 2
  if K > 2 and K % 2 == 0:
    flag_fail = 2
  else:
    for i in range(K):
      if S_temp[i] != S_temp[N - i - 1]:
        flag_fail = 3
        break
        
  if flag_fail != 0:
    print('No')
    break
  else:
    S = []
    S = S_temp[0:K]
if flag_fail == 0:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

def Pal(S_):
    S_len = (len(S_) - 1) // 2
    S_left = S_[:S_len]
    S_right = S_[S_len + 1:]
    S_right = S_right[::-1]
    if S_left == S_right:
        return True
    else:
        return False

if Pal(S):
    S_l = S[:(len(S) - 1)//2]
    S_r = S[(len(S) + 3)//2 - 1:]
    if Pal(S_l) and Pal(S_r):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

if (n//2) % 2 == 0 or n == 3:
    print("No")
    exit()

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

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

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

print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = "Yes"
half = int((n -1) / 2)
half2 = int((n+2)/2)
a = s[:half]
a_2 = s[half+1:n]
a_2 = a_2[::-1]
print(a, a_2)
if a != a_2:
    ans = "No"
else:
    if (len(a)%2) == 0:
        a_half = int(len(a)/2)
        a_3 = a[0:a_half]
        a_4 = a[a_half:len(a)]
        a_4 = a_4[::-1]
    else:
        a_half = int((len(a)+1)/2)
        a_3 = a[0:a_half]
        a_4 = a[a_half-1:len(a)]
        a_4 = a_4[::-1]
    print(a_3, a_4)
    if a_3 != a_4:
        ans = "No"
    else:
        b = s[half2:n]
        if (len(b)%2) == 0:
            b_half = int(len(b)/2)
            b_2 = b[0:b_half]
            b_3 = b[b_half:len(b)]
            b_3 = b_3[::-1]
        else:
            b_half = int((len(b)+1)/2)
            b_2 = b[0:b_half]
            b_3 = b[b_half-1:len(b)]
            b_3 = b_3[::-1]            
        print(b_2, b_3)
        if b_2 != b_3:
            ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:

s = input()

def isKaibun(str1):
    halflen = len(str1) // 2
    back = ''.join(reversed(str1[halflen+1:]))
    if str1[:halflen] == back:
        return True
    else:
        return False

if isKaibun(s):
    front = (len(s)-1) // 2
    fs = s[:front]
    if isKaibun(fs):
        rear = (len(s)+3) // 2
        rs = s[rear-1:]
        if isKaibun(rs):
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True
s = str(input())
if is_kaibun(s)==True:
    ku = int((len(s)-1)/2)
    news = s[:ku]
    a = 0
    for a in range(len(news)//2):
        if news[a] != news[-a-1]:
            print("No")
        else:
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# n,m = map(int, input().split())
s = input()

l = len(s)
f = int((l-1)/2)
b = int((l+3)/2) - 1

# print(f,b)

if s != s[::-1] or s[:f] != s[:f:-1] or s[b:] != s[b:][::-1]: 
  # print(s[::-1])
  print("No")

# if :
#   print(s[:f:-1])
#   print("No")

# if :
#   print(b,":",s[b:][::-1])
#   print("No")

print("Yes")

Submission status: Wrong Answer

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

y = s[0:3]
a = y[::-1]

z = s[4:7]
b = z[::-1]


if list(s) == list(x) and list(y) == list(a) and list(z) == list(b):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import sys
s =input()
n = len(s)
hn = int((n-1)/2)
qn = int((n+3)/4)
for i in range(qn):
  if s[i] == s[hn-i-1] and s[-i-1] == s[i-hn] and s[i] == s[-i-1]:
    pass
  else:
    print(i)
    print(s[-i])
    print(s[i-hn])
    print(s[i])
    print(s[hn-i-1])
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

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

Flag1 = False
Flag2 = False
Flag3 = False

if S == S[::-1]:
    Flag1 = True

if S[:(N-1)//2] == S[:(N-1)//2:-1]:
    Flag2 = True
    
if S[(N+3)//2-1:] == S[(N+3)//2-3::-1]:
    Flag3 = True

if Flag1 and Flag2 and Flag3:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = input()
s1 = s[::-1]
l=len(s)

check = 0
if(s==s1):
    if(s[0:int((l-1)/2)] == s1[0:int((l-1)/2)]):
        if(s[int((l+3)/2):l] == s[int((l+3)/2):l]):
            print("Yes")
            check =1
if(check ==0):
    print("No")

Submission status: Wrong Answer

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

cnt = 0
S_1 = S[0:(N-1)//2]
S_2 = S[(N+3)//2-1:N]

for i in range(len(S_1)//2):
    if S_1[i] == S_1[-i-1]:
        cnt += 1
if cnt == len(S_1)//2:
    new_cnt = 0
    for x in range(len(S_2)//2):
      if S_2[x] == S_2[-x-1]:
        new_cnt += 1
    if new_cnt == len(S_2)//2:
      print('Yes')
    else:
      print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def F(s):
	return s[:len(s)//2:-1] in s

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

Submission status: Wrong Answer

Solution code:
s = [str(i) for i in input()]
n = len(s)

sa = s[0:(n-1)//2]
sb = s[(n+1)//2:n]

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

if palindrome(sa) and palindrome(sb):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

s_list = list(s)
r_list = list(s)
r_list.reverse()

first_s_list = s_list[0:(n - 1) // 2]
first_r_list = reversed(first_s_list)

last_s_list = s_list[(n + 3) // 2:n]
last_r_list = reversed(last_s_list)

if s_list == r_list and first_s_list == first_r_list and last_s_list == last_r_list:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

S = input()
# A = int(input())
# A = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

pivot = len(S)//2
S1 = S[:pivot]
S2 = S[pivot+1:][::-1]
if S1 != S2:
    print('No')
    exit()

N = len(S)
S_ = S[:(N-1)//2]
# print(S_)

if N == 1:
    print('Yes')
    exit()
elif N%2 == 0:
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot:][::-1]
    if S1_ != S2_:
        print('No')
        exit()
else:
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot+1:][::-1]
    if S1_ != S2_:
        print('No')
        exit()

N = len(S)
S_ = S[(N+3)//2-1:N]
# print(S_)
if N == 1:
    print('Yes')
    exit()
elif N%2 == 0:
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot:][::-1]
    if S1_ != S2_:
        print('No')
        exit()
else:
    pivot = len(S_)//2
    S1_ = S_[:pivot]
    S2_ = S_[pivot+1:][::-1]
    if S1_ != S2_:
        print('No')
        exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
s=input()

def kai(s):
    if len(s)//2 == 0:
        if s[:int(len(s)/2-1)] == s[int(len(s)/2):]:
            return True
        else:
            return False

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

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

Submission status: Wrong Answer

Solution code:
S=input()
N=int((len(S)-1)/2)
m=""
for i in range(N):
    m=m+S[i]

def kaibun(a):
    m1=""
    m2=""
    for i in range(int((len(a)-1)/2)):
        m1=m1+a[i]
        m2=m2+a[len(a)-(i+1)]
    if m1==m2:
        return True
    else:
        return False

if kaibun(S) and kaibun(m):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()


s1 = s[0:len(s)//2]
s2 = s[len(s)//2+1:len(s)]

def reverse(s): 
    return s[::-1]

def isPalindrome(s): 
    rev = reverse(s) 
  
    if (s == rev): 
        return True
    return False

if isPalindrome(s1):
    if isPalindrome(s2):
            print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = input()
s1 = s[::-1]
l=len(s)
print(l)
check = 0
if(s==s1):
    if(s[0:int((l-1)/2)] == s1[0:int((l-1)/2)]):
        if(s[int((l+3)/2):l] == s[int((l+3)/2):l]):
            print("Yes")
            check =1
if(check ==0):
    print("No")

Submission status: Wrong Answer

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

def sc(s):
  l = len(s)
  if l == 2:
    r = s[0] == s[1]
  elif l == 3:
    r = s[0] == s[2]    
  elif s[0] == s[l-1]:
    r = sc(s[1:l-1])
  else:
    r = False
  return r
   
s = input()
l1 = int((len(s)-1)/2)
l2 = int((len(s)+3)/2 - 1)
if (sc(s) and sc(s[:l1]) and sc(s[l2:])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
letters = input()

def kaibun_check(letters):
    count = 0
    if len(letters)%2 == 0 and len(letters)>0:
        return False
    for _ in range(len(letters)//2):
        count += 1
        if letters[count-1] != letters[-count]:
            return False
    return True

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

Submission status: Wrong Answer

Solution code:
S = str(input())
N = len(S)
a = (N-1)//2
b = (N+3)//2
c = a//2
d = c + a%2
head = S[0:a]
tail = S[b-1:N]
ans = 'Yes'

for i in range(a):
  if S[i] != S[N-1-i]:
    ans = 'No'
for i in range(c):
  if head[i] != head[d-i]:
    ans = 'No'
for i in range(c):
  if tail[i] != tail[d-i]:
    ans = 'No'

print(ans)

Submission status: Wrong Answer

Solution code:
def isKaibun(s):
  for a, b in zip(s, reversed(s)):
    if a != b:
      return False
  return True

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

Submission status: Wrong Answer

Solution code:
given = input()
n = len(given)
left, rite = given[:n//2], given[n//2+1:]
print("Yes" if left == left[::-1] and rite == rite[::-1] else "No")

Submission status: Wrong Answer

Solution code:
S=str(input())
N=len(S)
p=0
a=0
c=0


for i in range(int((N-1)/2)):
        if S[i]==S[-i-1]:
            p+=1
if p==(N-1)/2:
    for i in range(int((N-1)/4)):
        T=S[:int((N-1)/2)]
        if T[i]==T[-i-1]:
                a+=1
    if a==int((N-1)/4):

        for y in range(int((N-(N+3)/2)/2)):

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

            if F[y]==F[-y-1]:
                c+=1
        if c==(int((N-(N+3)/2)/2)):
            print("yes")
        else:
            print("No")


    else:
        print("No")


else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)

s = input()
n = len(s)
a = n-1
b = n-3
en = a/2
sta = b/2
bb = n - int(sta) + 1
ans = 0

if en % 2 == 0:
    mid = int(en)/2
else:
    aa = int(en)-1
    mid = aa/2

if bb % 2 == 0:
    mid2 = bb/2
else:
    cc = bb-1
    mid2 = cc/2

for v in range(int(mid)):
    if s[v] == s[int(en) - v - 1]:
        ans += 1
for k in range(int(mid2)):
    if s[int(sta) + k] == s[n - k - 1]:
        ans += 1

if ans == int(mid) + int(mid2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
sen=input()
n=len(sen)
def func(arg):
  n=len(arg)
  if len(arg)%2==0:
    maemae=arg[:int(n/2)]
    usiusi=arg[int(n/2):]
    if usiusi+maemae!=arg:
      return False
    else:
      return True
  else:
    maemae=arg[:n//2]
    aidaaida=arg[n//2]
    usiusi=arg[n//2+1:]
    if usiusi+aidaaida+maemae!=arg:
      return False
    else:
      return True


mae=sen[:n//2]
aida=sen[n//2]
usiro=sen[n//2+1:]
if usiro+aida+mae!=sen:
    print('No')
else:
  if func(mae)+func(usiro)==2:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
first = (N-1) // 2
second = (N+3) // 2
#print("first, second", N, first, second)
ans = 'Yes'
for i in range(first):
  #print("i", i)
  if not(S[i] == S[first-1-i]):
    ans = 'No'
for i in range(second -1, N):
  #print("i", i)
  #print(i - (second - 1))
  if not(S[i] == S[N-1 - (i - (second - 1))]):
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
st=input()
def iskaibun(s):
    if(s==""):
        return 1;
    else:
        if(s[0]==s[-1]):
            return iskaibun(s[1:-1])
        else:
            return 0
l = len(st)
q = (l-1)//2
st1 = st[0:q]
st2 = st[q+1:]
if(iskaibun(st1)==1 and iskaibun(st2)==1):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
if len(s)==3 or len(s)==5:
    print('No')
    exit(0)
print('Yes' if (s[:(len(s)-1)//2]==s[(len(s)-1)//2+1:][::-1]
               and len(s[:(len(s)-1)//2])%2!=0
               and s[:((len(s)-1)//2-1)//2] == s[((len(s)-1)//2-1)//2+1:(len(s)-1)//2][::-1]
               and s[(len(s)-1)//2+1:len(s)-((len(s)-1)//2//2)-1]==s[len(s)-((len(s)-1)//2//2):][::-1]
                )or (len(s[:(len(s)-1)//2])%2==0
    and len(s[:(len(s)-1)//2])%2==0
               and s[:((len(s)-1)//2)//2] == s[((len(s)-1)//2)//2:(len(s)-1)//2][::-1]
               and s[(len(s) - 1) // 2 + 1:len(s) - ((len(s) - 1) // 2 // 2)] == s[len(s) - (
            (len(s) - 1) // 2 // 2):][::-1])
      else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s2 = s[:int((n-1)/2)]
n2 = len(s2)
#print(s2)

a = ""
b = ""

if len(s2) %2 == 1:
  a = s2[:int((n2-1)/2)]
  b = s2[int(int((n2-1)/2) + 1):]
else:
  a = s2[:int((n2)/2)]
  a = a[::-1]
  b = s2[int(int((n2)/2)):]
#print(a)
#print(b)

  
s3 = s[int((n+3)/2 - 1):]
n3 = len(s3)
#print(s3)
a2 = ""
b2 = ""

if len(s3) %2 == 1:
  a2 = s3[:int((n3-1)/2)]
  b2 = s3[int(int((n3-1)/2) + 1):]
else:
  a2 = s3[:int((n3)/2)]
  a2 = a2[::-1]
  b2 = s3[int(int((n3)/2)):]
#print(a2)
#print(b2)


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

Submission status: Wrong Answer

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


def judge_kaibun(S):
    n = len(S)
    center = n//2
    return S[:center] == S[-center:][::-1]


pre_judge = judge_kaibun(S[:(N-1)//2])
pos_judge = judge_kaibun(S[(N+3)//2-1:])

if pre_judge and pos_judge:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a     = list(input())
a_re  = reversed(a)


if a == a_re:
  if len(a) % 2 == 0:
    b = a[0:len(a)]
    b_re = a_re[0:len(a)]
    b_re = reversed(b_re)
    if b == b_re:
      print('Yes')
    else:
      print('No')
  else:
    b = a[0:int(len(a)/2)]
    b_re = a_re[0:int(len(a))]
    b_re = reversed(b_re)
    if b == b_re:
      print('Yes')
    else:
      print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
def isPalindrome(s): 
      
    # Using predefined function to  
    # reverse to string print(s) 
    rev = ''.join(reversed(s)) 
  
    # Checking if both string are  
    # equal or not 
    if (s == rev): 
        return True
    return False
  
# main function 
s = input()
ans = isPalindrome(s) 
  
if (ans): 
    print("Yes") 
else: 
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
count = 0
ans = True
while count <= n:
  for i in range(1,n+1):
    if s[i-1]!=s[-i]:
      ans = False
    
  for i in range(1,int((n-1)/2)+1):
    if s[i-1]!=s[-i]:
      ans = False
      
  for i in range(int((n+3)/2)+1, n+1):
    if s[i-1]!=s[-i]:
      ans = False
      
  count += 1

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

Submission status: Wrong Answer

Solution code:
S = input()
R = S.lower()
rev_R = reversed(R)
if list(rev_R) == list(R):
    print("Yes")
else:
    print("No")