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:
S = input()
a=''
b=''
c=''
d=''
# for i in range(0,int((len(S)-1)/2)):
#     a+=S[i]
# for i in range(int((len(S)-1)/2)-1,-1,-1):
#     b+=S[i]
# for j in range(int((len(S)+3)/2)-1,len(S)):
#     c+=S[j]
# for j in range(len(S)-1,int((len(S)+3)/2)-2,-1):
#     d+=S[j]

# # print(a)
# # print(b)
# # print(c)
# # print(d)
# if a == b and c==d:
#     print('Yes')
# else:
#     print('No')

mae = ''
usiro = ''
N = len(S)
mae = S[0:int((N-1)/2)]
eam = S[-int((N-1)/2):]
usiro = S[int((N+3)/2)-1:]
orisu = S[-int(((N+3)/2))+2:]
# print(mae)
# print(eam)
# print(usiro)
# print(orisu)
# for i in range(len(mae)-1,-1,-1):
#     a += mae[i]
# # print(a)
# for i in range(len(usiro)-1,-1,-1):
#     b += usiro[i]
# # print(b)

for i in reversed(mae):
    a += i
# print(a)
for i in reversed(usiro):
    b += i

if mae == a and usiro == b:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
a=''
b=''
c=''
d=''
# for i in range(0,int((len(S)-1)/2)):
#     a+=S[i]
# for i in range(int((len(S)-1)/2)-1,-1,-1):
#     b+=S[i]
# for j in range(int((len(S)+3)/2)-1,len(S)):
#     c+=S[j]
# for j in range(len(S)-1,int((len(S)+3)/2)-2,-1):
#     d+=S[j]

# # print(a)
# # print(b)
# # print(c)
# # print(d)
# if a == b and c==d:
#     print('Yes')
# else:
#     print('No')

mae = ''
usiro = ''
N = len(S)
mae = S[0:int((N-1)/2)]
eam = S[-int((N-1)/2):]
usiro = S[int((N+3)/2)-1:]
orisu = S[-int(((N+3)/2))+2:]
# print(mae)
# print(eam)
# print(usiro)
# print(orisu)
for i in range(len(mae)-1,-1,-1):
    a += mae[i]
# print(a)
for i in range(len(usiro)-1,-1,-1):
    b += usiro[i]
# print(b)

if mae == a and usiro == b:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
a=''
b=''
c=''
d=''
for i in range(0,int((len(S)-1)/2)):
    a+=S[i]
for i in range(int((len(S)-1)/2)-1,-1,-1):
    b+=S[i]
for j in range(int((len(S)+3)/2)-1,len(S)):
    c+=S[j]
for j in range(len(S)-1,int((len(S)+3)/2)-2,-1):
    d+=S[j]

# print(a)
# print(b)
# print(c)
# print(d)
if a == b and c==d:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main(S):
    N = len(S)
    if N % 2 == 0:
        if S == S[::-1]:
            return True
        else:
            return False
    elif S == S[::-1] and main(S[:((N - 1) // 2)]) == True and main(S[((N + 1) // 2):]) == True:
        return True
    else:
        return False
S = list(input())
if main(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main(S):
    N = len(S)
    if N % 2 == 0:
        if S == S[::-1]:
            return True
        else:
            return False
    elif S == S[::-1] and main(S[:(N - 1) // 2]) == True and main(S[(N + 1) // 2 :]) == True:
        return True
    else:
        return False
S = list(input())
if main(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main(S):
    N = len(S)
    if N > 1:
        if N % 2 == 0:
            if S == S[::-1]:
                return True
            else:
                return False
        elif S == S[::-1] and main(S[:(N - 1) // 2]) == True and main(S[(N + 1) // 2 :]) == True:
            return True
        else:
            return False
    else:
        return True
S = list(input())
if main(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main(S):
    N = len(S)
    if N > 0:
        if N % 2 == 0:
            if S == S[::-1]:
                return True
            else:
                return False
        elif S == S[::-1] and main(S[:(N - 1) // 2]) == True and main(S[(N + 1) // 2 :]) == True:
            return True
        else:
            return False
    else:
        return True
S = list(input())
if main(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main(S):
    N = len(S)
    if N > 0:
        if S == S[::-1] and main(S[:(N - 1) // 2]) == True and main(S[(N + 1) // 2 :]) == True:
            return True
        else:
            return False
    else:
        return True
S = list(input())
if main(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
cnt = 0
for i in range(2):
    if i==1: x = s[:n//2]
    else: x = s[(n+3)//2-1:]
    if len(x) % 2 == 0:
        l,r = x[:len(x)//2], x[len(x)//2:][::-1]
    else:
        l,r = x[:len(x)//2+1], x[len(x)//2:][::-1]
    if l==r: cnt += 1
print("Yes" if cnt==2 else "No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

if S[:(N-1)//2] != ''.join(reversed(S[:(N-1)//2])):
    print('No')
    exit()

if S[(N+3)//2-1:] != ''.join(reversed(S[(N+3)//2-1:])):
    print('No')
    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 == s1[::-1] and s2 == s2[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s1 = s[:(n - 1) // 2]
s2 = s[(n + 3) // 2 - 1:]
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)
s1 = s[:(n - 1) // 2]
s2 = s[(n + 1) // 2:]
if s1 == s1[::-1] and s2 == s2[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

def kaibun(x):
    N = len(x)
    flag = True
    for i in range(N // 2):
        if S[i] != S[-i - 1] or N < 3:
            flag = False
    return flag

tmp1 = kaibun(S)
tmp2 = kaibun(S[:(len(S) - 1) // 2])
tmp3 = kaibun(S[(len(S) + 3) // 2:])

if tmp1 and tmp2 and tmp3:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
front = (n-1) // 2
rear = (n+2) // 2
sf = s[:front]
sr = s[rear:]
sfrev = sf[::-1]
srrev = sr[::-1]
if sfrev == sf and srrev == sr:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=list(input())
N=len(S)
A=S[:(N-1)//2]
B=S[(N+3)//2-1:]
K="Yes"
for i in range(len(A)//2):
    if A[i]!=A[-i-1]:
        K="No"
        break
for j in range(len(B)//2):
    if B[j]!=B[-j-1]:
        K="No"
        break
print(K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)-1
a = int((n-1)/2)
b = int((n+3)/2)
i = 0
a_cnt = 0
rslt = 0

for _ in s:
  if i <= a and n >= b:
    right = s[i]
    left = s[n]
    if right == left:
      rslt += 1
  n -= 1  
  i += 1
print("Yes") if rslt >= 3 else print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)-1
a = int((n-1)/2)
b = int((n+3)/2)
i = 0
rslt = 0

for _ in s:
  if i <= a and n >= b:
    right = s[i]
    left = s[n]
    n -= 1
    if right == left:
      rslt += 1
  i += 1
print("Yes") if rslt >= 3 else print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=str(input())
n=len(s)
new_n1=int((n-1)/2)
new_s1=s[:new_n1]

new_n2=int((n+3)/2)
new_s2=s[new_n2-1:]
for i in range(0,len(new_s1)):
 if new_s1[i]!=new_s1[-i-1]:
    print("No")
    exit()
else:
  pass
for i in range(0,len(new_s2)):
 if new_s2[i]!=new_s2[-i-1]:
    print("No")
    exit()
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s=str(input())
n=len(s)
new_n1=int((n-1)/2)
new_s1=s[0:new_n1]

new_n2=int((n+3)/2)
new_s2=s[new_n2:]

if new_s1[0:-1]!=new_s1[:-1]:
   print("No2")
   exit()
else:
  pass

if new_s2[0:-1]!=new_s2[:-1]:
    print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
s = str(input())

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

for i in range(len(s1)//2):
    if s1[i] != s1[-1-i] or s2[i] != s2[-1-i]:
        print("No")
        sys.exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())
length=len(s)
idx_half=int((length-1)/2)

if s==s[::-1] and s[:int((length-1)/2)]==s[int((length-1)/2)-1::-1] and s[int((length+3)/2-1):]==s[int((length+3)/2+1):idx_half:-1]:    
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
length=len(s)
idx_half=int((length-1)/2)

def no():
    import sys
    print('No')
    sys.exit()

if s!=s[::-1]:
    no()
if s[:int((length-1)/2)]!=s[int((length-1)/2)-1::-1]:
    no()
if s[int((length+3)/2-1):]!=s[int((length+3)/2+1):idx_half:-1]:
    no()
    
print('Yes')

Submission status: Wrong Answer

Solution code:
s=list(input())
length=len(s)
idx_half=int((length-1)/2)

def no():
    import sys
    print('No')
    sys.exit()

if s!=s[::-1]:
    no()
if s[:int((length-1)/2):-1]!=s[int((length-1)/2)-1::-1]:
    no()
if s[int((length+3)/2-1):]!=s[int((length+3)/2+1):idx_half:-1]:
    no()
print('Yes')

Submission status: Wrong Answer

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations


S=input()

N=int(len(S))

A1=S[:N//2]
A2=S[((N+3)//2)-1:]


chk = 0
for i in range((N-1)//2):
    if A1[i] != A1[((N-1)//2) - (N%2) - i]:
        print(i)
        chk = 1
        break
    if A2[i] != A2[((N-1)//2) - (N%2) - i]:
        chk = 1
        break

if chk == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations


S=input()

N=int(len(S))

A1=S[:N//2]
A2=S[((N+3)//2)-1:]

chk = 0
for i in range(len(A1)//2):
    if A1[i] != A1[len(A1)-i-1]:
        chk = 1
        break
for i in range(len(A2)//2):
    if A2[i] != A1[len(A2)-i-1]:
        chk = 1
        break
if chk == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
N1s = (N-1)//2
N1e = N-N1s

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
X=input()
n=len(X)
if n%2==0:
    print("No")
    sys.exit()
ans="No"
def check(y):
    before=y[0:int(len(y)/2)]
    after=y[int(len(y)/2):]
    comp=False
    if len(y)%2==1:
        after=after[1:]
    if after==before:
        comp=True
    return comp
ans="No"
if check(X):
    if check(X[0:int((n-1)/2)]):
        if check(X[int(((n+3)/2)-1):]):
            ans="Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())

N = int(len(S))
mi = int((N-1)/2)
mo = int((N+3)/2-1)
Smi = list(S[mi:])
Smo = list(reversed(S[:mo]))
if Smi == Smo and len(S)>5:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())

N = int(len(S))
mi = int((N-1)/2)
mo = int((N+3)/2-1)
Smi = list(S[mi:])
Smo = list(reversed(S[:mo]))
if Smi == Smo and len(S)>6 :
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = str(input())
mid = (len(s) + 1)//2

def palin(st):
    return st == st[::-1]

print('Yes' if palin(s[0:mid-1]) and palin(s[mid:]) else 'No')

Submission status: Wrong Answer

Solution code:
s = input()

result = True

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

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

Submission status: Wrong Answer

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
# list(map(int, input().split()))

S = input()
N = len(S)

l = S[:(N-1)//2]
r = S[(N + 3)//2 + 1:]

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

Submission status: Wrong Answer

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
# list(map(int, input().split()))

S = input()
N = len(S)

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

if l == l[::-1] and r == r[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
X=input()
n=len(X)
ans="No"
def check(y):
    before=y[0:int(len(y)/2)]
    after=y[int(len(y)/2):]
    comp=False
    if len(y)%2==1:
        after=after[1:]
    if after==before:
        comp=True
    return comp
ans="No"
if check(X):
    if check(X[0:int((n-1)/2)]):
        if check(X[int(((n+3)/2)-1):]):
            ans="Yes"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
N = len(S)
ans = 'Yes'
for i in range((N-1)//2):
    if S[i] != S[N-1-i]:
        ans = 'No'
        break

if ans == 'No' or ((N-1)//2)%2 == 0:
    ans = 'No'
else:
    for i in range(((N-1)//2-1)//2):
        if S[i] != S[(N-1)//2-1-i]:
            ans = 'No'
            break
        if S[(N-1)//2+1+i] != S[N-1-i]:
            ans = 'No'
            break
            
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
sa=s[:(n-1)//2]
sb=s[(n+1)//2:]
sar=""
sbr=""
for i in range(len(sa)):
    sar+=sa[len(sa)-i-1]
    sbr+=sb[len(sa)-i-1]
if sar==sa and sbr==sb:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

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

s=input()
l=len(s)
if(l%2==0):
  print("No")
else:
  if(kaibun(s[:((l-1)//2)])*kaibun(s)*kaibun(s[((l+1)//2):])):
    print("Yes")

Submission status: Wrong Answer

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

s=input()
l=len(s)
if(l%2==0):
  print("No")
else:
  if(kaibun(s[:((l-1)//2)])*kaibun(s)):
    print("Yes")

Submission status: Wrong Answer

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

s=input()
l=len(s)
if(l%2==0):
  print("No")
else:
  if(kaibun(s[:((l-1)//2)])*kaibun(s[((l+1)//2):])):
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

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

s=input()
l=len(s)
if(l%2==0):
  print("No")
else:
  if(kaibun(s[:((l-1)//2)])*kaibun(s[((l+1)//2):])):
    print("Yes")

Submission status: Wrong Answer

Solution code:
S=input()
a=len(S)
b=S[:int((a-1)//2)]
c=b[::-1]
d=S[int((a+3)//2)-1:]
e=d[::-1]
if b==c and d==e:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
N = len(S)
ans = 'Yes'
A = S[:(N+1)//2]
B = S[(N-1)//2:]
B = B[::-1]
if A != B:
  ans = 'No'
C = S[:(N-1)//2]
nc = len(C)
ac = C[:(nc+1)//2]
bc = C[(nc-1)//2:]
bc = bc[::-1]
if ac != bc:
  ans = 'No'
D = S[(N+1)//2:]
nd = len(D)
ad = D[:(nd+1)//2]
bd = D[(nd-1)//2:]
bd = bd[::-1]
if ad != bd:
  ans = 'No'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input()
if len(x) % 2 == 0 :
  adjust = 0
else:
  adjust = 1
xo = x[0:(len(x)-adjust)//2]
xr = ''.join(list(reversed(x[(len(x)+3)//2-1:])))
if xr == xo:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
x = input()
xr = ''.join(list(reversed(x[(len(x)+3)//2-1:])))
if xr == x[0:(len(x)-1)//2]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
def f(a,b):
  X = s[a-1:b]
  Y = X[-1::-1]
  if X == Y:
    return(1)
  else:
    return(0)
  
if f(0,len(s)) * f(1,(n-1)//2) * f((n+3)//2,len(s)) == 1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = (len(S)-1)//2
M = (len(S)+3)//2
count = 0

if S[::-1] == S:
  if S[:N] == S[:N][::-1]:
    if S[M:] == S[M:][::-1]:
      count += 1
print("Yes" if count == 1 else "No")

Submission status: Wrong Answer

Solution code:
S = input()
N = (len(S)-1)//2
M = (len(S)+3)//2
count = 0

if S[::-1] == S:
  if S[:N] == S[:N][::-1]:
    if S[:M] == S[:M][::-1]:
      count += 1
print("Yes" if count == 1 else "No")

Submission status: Wrong Answer

Solution code:
S = input()
N = (len(S)-1)//2
M = (len(S)+3)//2
count = 0

if S[::-1] == S:
  if S[:N] == S[::-N]:
    if S[:M] == S[::-M]:
      count += 1
print("Yes" if count == 1 else "No")

Submission status: Wrong Answer

Solution code:
import math as mt
#import numpy as np

def ro(n):
  return mt.floor(mt.sqrt(n))
def ya():
  print("Yes")
  return
def na():
  print("No")
  return


#a,b=map(int,input().split())
#lis=list(map(int,input().split()))
#n=int(input())
s=input()
if s!=s[::-1]:
  na()
n=(len(s)+1)//2
if s[:n-1]!=s[n:]:
  na()
else:
  ya()

Submission status: Wrong Answer

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
s = input()
r = s[::-1]

if len(s)%4 == 3:
    if s==r:
        print("Yes")
    else:
        print("No")

else :
    print("No")

Submission status: Wrong Answer

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
s = input()
flag = "Yes"

if len(s)%2 == 0:
    flag = "No"

a = int(len(s)/2)
if a%2 == 0:
    flag = "No"

else:
    for i in range(a):
        if s[i] != s[a-(i+1)] or s[i] != s[a+1+i] or s[i] != s[len(s)-(i+1)]:
            flag = "No"

print(flag)

Submission status: Wrong Answer

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
s = input()
flag = "Yes"

a = int(len(s)/2)
if a%2 == 0:
    flag = "No"

else:
    for i in range(a):
        if s[i] != s[a-(i+1)] or s[i] != s[a+1+i] or s[i] != s[len(s)-(i+1)]:
            flag = "No"

print(flag)

Submission status: Wrong Answer

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
s = input()
flag = "Yes"

a = int(len(s)/2)
if a%2 == 0:
    flag = "No"

else:
    for i in range(a):
        if s[i] != s[len(s)-(i+1)]:
            flag = "No"

print(flag)

Submission status: Wrong Answer

Solution code:
S=input()
R=S[::-1]
T=S[:3]
U=T[::-1]
V=S[-3:]
W=V[::-1]
if S==R and T==U and V==W:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=list(map(str,input().split()))
R=S[::-1]
T=S[:3]
U=T[::-1]
V=S[-3:]
W=V[::-1]
if S==R and T==U and V==W:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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()
A = S[:3]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
if N in range(7,100,4):
    if S == S[::-1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
sa = s[:len(s)//2]
sb = s[len(s)//2+1:]
if sa == sb[::-1]:
    saa = sa[:len(sa)//2]
    if len(sa)%2==1:
        sab = sa[len(sa)//2+1:]
    else:
        sab = sa[len(sa)//2:]
    if saa == sab[::-1]:

        ss = s[len(sa)+3//2:]
        if len(ss) in [1]:
            print('Yes')
            exit()
        ssa = ss[:len(ss)//2]
        if len(ssa)%2==1:
            ssb = ss[len(sa)//2+1:]
        else:
            ssb = ss[len(sa)//2:]
        if ssa == ssb[::-1]:

            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

Solution code:
s = input()
sa = s[:len(s)//2]
sb = s[len(s)//2+1:]
if sa == sb[::-1]:
    saa = sa[:len(sa)//2]
    if len(sa)%2==1:
        sab = sa[len(sa)//2+1:]
    else:
        sab = sa[len(sa)//2:]
    if saa == sab[::-1]:

        ss = s[len(sa)+3//2:]
        ssa = ss[:len(ss)//2]
        if len(ssa)%2==1:
            ssb = ss[len(sa)//2+1:]
        else:
            ssb = ss[len(sa)//2:]
        if ssa == ssb[::-1]:

            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input()) #gvg
l = len(s) # l = 3
j = l - 1 # j = 2

for i in range(l // 2):
    if s[i] != s[j]:
        print('No')
        exit(0)
    j -= 1

h = (l + 3) // 2 - 1
if h == 2:
    j = 0
else:
    j = h // 2

for h in range(l // 2):
    if s[h] != s[j]:
        print('No')
        exit(0)
    j -= 1

print('Yes')

Submission status: Wrong Answer

Solution code:
s = list(input())
l = len(s)
j = -1

for i in range(l // 2):
    if s[i] != s[j]:
        print('No')
        exit(0)
    j -= 1

h = (l + 3) // 2 - 1
j = h // 2

for h in range(l):
    if s[h] != s[j]:
        print('No')
        exit(0)
    j -= 1
    
print('Yes')

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    n=len(s)
    a=s[0:n//2]
    b=s[n//2:n]

    #return True
    #return False

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: Wrong Answer

Solution code:
def f(X):
  for i in range(len(X)):
    if X[i] != X[(-1)*(i+1)]:
      return 0
    break
  return 1

s = list(input())
n = len(s)
A = s[0:int((n-1)/2)]
B = s[int((n+3)/2)-1:n]
if f(s) * f(A)*f(B) == 1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


if s==s1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
s=input()

s1=reversed(s)

if s==s1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ss = s[:len(s) // 2]

ans = "Yes"
if ss != ss[::-1]: ans = "No"

print(ans)

Submission status: Wrong Answer

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

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

print(s1)
print(s2)

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)

s1 = s[:n//2]
s2 = s[(n//2)+1:]
if s == s[::-1]:
  if s1 == s2 and s2 ==  s2[::-1]:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9


def check_palindrome(w):
    for i in range(len(w)//2):
        print(w[i], w[-i-1])
        if w[i] != w[-i-1]:
            return False
    return True

def main():
    S = input()

    n = len(S)//2
    is_palindrome1 = check_palindrome(S)
    is_palindrome2 = check_palindrome(S[:n])
    is_palindrome3 = check_palindrome(S[n+1:])
    if is_palindrome1 and is_palindrome2 and is_palindrome3:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def kai(l,r):
    ss=s[l:r+1]
    nn=len(ss)
    #print(ss)
    for i in range(int((nn-1)/2)):
        if ss[i]==ss[nn-i-1]:
            if i==int((nn-1)/2)-1:
                return 'Yes'
        else:
            return 'No'
            break

if kai(0,n-1)=='Yes':
    if kai(0,int((n-1)/2)-1)=='Yes':
        if kai(int((n+3)/2)-1,n-1)=='Yes':
           print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if left == left[::-1] and right == right[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if left == left[::-1] and right == right[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
# print(s[:int((n-1)/2)])
# print(s[int((n+3)/2):])
if n <= 6:
  print('No')
elif s[:int((n-1)/2)] == s[int(((n+3)/2)-1):]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
# print(s[:int((n-1)/2)])
# print(s[int((n+3)/2):])
if n < 6:
  print('No')
elif s[:int((n-1)/2)] == s[int(((n+3)/2)-1):]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
x = len(s) // 2 + 1
b = s[:len(s) // 2 + 1]
c = s[len(s) // 2:]

if b == b[::-1] and c == c[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if s == s[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

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

l = s[:int((n-1)/2)]
r = s[int((n+1)/2):]


if l != r:
    print("No")
    exit()
ll = l[:int((len(l)-1)/2)]
lr = l[int((len(l)+1)/2):]

if ll != lr:
    print("No")
    exit()

rl = r[:int((len(l)-1)/2)]
rr = r[int((len(l)+1)/2):]

if rl != rr:
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

l = s[:int((n-1)/2)]
r = s[int((n+1)/2):]


if l != r:
    print("No")
    exit()
ll = l[:int((len(l)-1)/2)]
lr = l[int((len(l)+1)/2):]

if ll != lr:
    print("No")
    exit()

rl = r[:int((len(l)-1)/2)]
rr = r[int((len(l)+1)/2):]

if rl != rr:
    print("No")
    exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
s = input()
c= 0
for i in range(len(s)//2):
    if (s[i] != s[(len(s)-1)//2-i-1]) or (s[(len(s)-1)//2+i+1] != s[len(s)-i-1]):
        c = 0
        break
    else:
        c +=1

if c >0:
    print("Yes")
else:
    print("No")