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:
string_values = list(input())
size = len(string_values)
half_size = int((size - 1) / 2)
half_last_size = int((size + 3) / 2)

count = 0
is_true = True
for string_value in string_values:
    if string_value != string_values[size - count - 1]:
        is_true = False
    if count > half_size:
        break
    count += 1

count = 0
for string_value in string_values:
    if string_value != string_values[half_size - count - 1]:
        is_true = False
    if count + 1 == half_size:
        break
    count += 1

count = 0
check_count = 0
for string_value in string_values:
    if count + 1 < half_last_size:
        count += 1
        continue
    if string_value != string_values[size - check_count - 1]:
        is_true = False
        check_count += 1
    count += 1


answer = "No"
if is_true:
    answer = "Yes"
print(answer)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
X = (N-1)//2
flag = True
bun = True
if X%2 == 0:
  bun = False

for i in range((N-1)//2):
  if S[i] != S[-1-i]:
    flag = False
if bun == True:
  for i in range((X-1)//2):
    if S[i] != S[X-i-1]:
      flag = False
  for i in range((X-1)//2):
    if S[X+1] != S[-1-i]:
      flag = False
else:
  for i in range(X//2):
    if S[i] != S[X-i-1]:
      flag = False
  for i in range(X//2):
    if S[X+1+i] != S[-1-i]:
      flag = False
    
if N == 5:
  if S[0] != S[1]:
    flag = False
  elif S[-1] != S[-2]:
    flag = False
if flag == False:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s_list = list(input())
l = len(s_list)

t = False
if l%4 == 1:
    c_num = int((l-1)/4)
    c_l = s_list[:c_num]
    t_1 = s_list[c_num:2*c_num][::-1]
    t_2 = s_list[2*c_num+1:3*c_num+1]
    t_3 = s_list[3*c_num+1:][::-1]

    if c_l == t_1 == t_2 == t_3:
        t = True

if l % 4 == 3:
    c_num = int((l - 3) / 4)
    c_l = s_list[:c_num]
    t_1 = s_list[c_num+1 :2 * c_num + 1][::-1]
    t_2 = s_list[2 * c_num + 2:3 * c_num + 2]
    t_3 = s_list[3 * c_num + 3:][::-1]

    if c_l == t_1 == t_2 == t_3:
        t = True

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

Submission status: Wrong Answer

Solution code:
import copy
S = list(input())
N = len(S)
ReS = copy.copy(S)
o = 1
for i in S:
    ReS[N-o] = i
    o += 1
if S == reversed(S):
    print("Yes")
if S == ReS:
    if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]:
        if S[int(N+1/2): N] == ReS[0:int((N-1)/2)]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
        print("No")

Submission status: Wrong Answer

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

def main():
    s = input()
    condtion1 = (len(s) - 1) // 2 - 1
    condtion2 = (len(s) + 3) // 2 - 1
    flag = False
    for i, j in [(0, condtion1), (condtion2, len(s))]:
        if isBatch(s[i:j]):
            flag = True
        else:
            flag = False
    if flag:print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
a     = list(input())

a_len = len(a)
a_len_= int((a_len-1)/2)

a_    = a[0:a_len_]
a_re  = list(reversed(a))
a_re_ = a_re[0:a_len_]

a_len_round = round(a_len_/2)
a_round = a[0:a_len_round]
a_re_round_re = list(reversed(a_re_))
a_re_round_re_ = a_re_round_re[0:a_len_round]

if a_len_ % 2 == 0:
  print('No')
else:
  if a == a_re:
    if a_round == a_re_round_re_ :
      print('Yes')
    else:
      print('No')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
x = len(s)
a = s[:x//2]
b = s[x//2+1:]
b.reverse()
y = len(a)
c = a[:y//2]
d = a[y//2+1:]
d.reverse()
e = b[y//2+1:]
e.reverse()
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:
import sys
s =input()
n = len(s)
hn = int((n+1)/2)
qn = int((n+1)/4)
for i in range(qn):
  if s[i] == s[n-hn-i-1] and s[-i-1] == s[i+hn-n] and s[i] == s[-i-1]:
    pass
  else:
    print(i)
    print(s[-i])
    print(s[i-hn])
    print(s[i])
    print(s[n-hn-i-1])
    print("No")
    sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []
rev = []
rev2 = []
rev3 = []

for i in range(N):
  kai.append(S[i])

for i in range(0, int((N - 1) / 2)):
  kai2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  kai3.append(S[i])

kai.reverse
kai2.reverse
kai3.reverse

for i in range(N):
  rev.append(S[i])

for i in range(0, int((N - 1) / 2)):
  rev2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  rev3.append(S[i])
  
if kai == rev:
  if kai2 == rev2:
    if kai3 == rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
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:]

if S1[0:(n-1)//2]==S1[(n-1)//2::-1] and S2[0:(n-1)//2]==S2[(n-1)//2::-1]:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

def isKaibun(s, length):
    flag = True
    if len(s)%2 == 0:
        return False
    for i in range(int((length-1)/2)):
        if s[i] != s[length-1-i]:
            flag = False
            break
    return flag



orta = int((n+1)/2)-1

if isKaibun(s, n) and isKaibun(s[:orta], orta) and isKaibun(s[orta+1:], orta):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
k=0
s1=s[:(n-1)//2]
s2=s[(n+3)//2-1:]
for i in range(len(s1)//2):
    if s1[i]==s[-i-1]:
        pass
    else:
        k=1
        break
for j in range(len(s2)//2):
    if s2[j]==s[-j-1]:
        pass
    else:
        k=1
        break
if k==1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S=str(input())

N=len(S)
i=0
r="No"

s=int((N-1)/2)
t=int((N+3)/2)

a=S[0:s]
b=S[t-1:N]

if(a==(a[::-1]) and b==(b[::-1])):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

s_1 = s[:(h-1)//2]
h_1 = len(s_1)//2+1

s_2 = s[(h+3)//2-1:]
h_2 = len(s_2)//2+1

ans = 0

for a, b in zip(s_1[:h_1], reversed(s_1[h_1:])):
    if a!=b:
        ans -= 10000000000
        break
    else:
        ans += 1
        continue

for a, b in zip(s_2[:h_2], reversed(s_2[h_2:])):
    if a!=b:
        ans -= 10000000000
        break
    else:
        ans += 1
        continue


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

Submission status: Wrong Answer

Solution code:

def main():
    s = input()
    if len(s) % 2  == 0:
        print("No")
        return
    N = int(len(s))
    print(N)
    s1 = s[0:int((N-1)/2)]
    s2 = s[int((N+1)/2):N]

    print(s1)
    print(s2)

    i = 0
    j = int((N - 1) / 2) - 1
    print(j)
    while True:
        if i > j:
            break
        if s1[i] != s1[j]:
            print("No")
            return
        i += 1
        j -= 1

    i = 0
    j = int((N - 1) / 2) - 1
    while True:
        if i > j:
            break
        if s2[i] != s2[j]:
            print("No")
            return
        i += 1
        j -= 1


    print("Yes")
    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
S = list(input())
n0 = len(S)
if n0 == 3:
    print("No")
else:

    def kaibun(S):
        c = 0
        N = len(S)
        n = N // 2
        for i in range(n):
            if S[i] != S[N-1-i]:
                c = 1
                break
        return c
    if kaibun(S) == 0:
        s1 = S[0:n0 //2 ]
        s2 = S[n0 // 2 +1:n0]
        print(s1)
        print(s2)
        if kaibun(s1) == 0 and kaibun(s2) == 0:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

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


def isPalindrome(s):
    # Calling reverse function
    rev = reverse(s)

    # Checking if both string are equal or not
    if (s == rev):
        return True
    return False


S = input()
if isPalindrome(S):
    a = S[0: int((len(S) - 1) / 2)]
    b = S[int((len(S)+3)/2-1): len(S)]
    if isPalindrome(a) and isPalindrome(S):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
S=input()
cnt=0

L=int((len(S)-1)/2)
#print(L)
for i in range(L):
    #print(S[i])
    #print(S[-(i+1)])
    if S[i]==S[-(i+1)]:
        cnt+=1
        
if cnt==L:
    S=S[0:L]
    cnt=0
    #print(S)
    L=int((len(S)-1)/2)
    #print(L)
    for i in range(L):
        #print(S[i])
        #print(S[-(i+1)])
        if S[i]==S[-(i+1)]:
            cnt+=1
    #print(cnt)
    #print(L)
    if cnt==L:
        print('Yes')
    else:
        print('No')
        
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
n = len(s)
N = int((n-1)/2)
M = int((n+3)/2)
l = []
m = []
for i in range(N):
    l.append(s[i])
for i in range (M-2,N-1):
    m.append(s[i])
a = ''.join(l)
b = ''.join(m)
l.reverse()
m.reverse()
A = ''.join(l)
B = ''.join(m)
if (a==A and b==B):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
s=list(input())
k=0
q=0
n=len(s)
l=[s[0]]*n
if l==s:
  print("Yes")
  sys.exit()
for i in range((n-1)//2):
  if s[i]==s[n-1-i]:
    k+=1
if k==(n-1)//2 and (n-1)%4!=0:
  for i in range((n-1)//4):
    if s[i]==s[(n-1)//2-1-i]:
      q+=1
  if q==(n-1)//4:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
num = int((n-1)/2)-1
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
num = int(num /2 -1)
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()

num = int(len(s) * 0.5 - 1.5)
index = int((n + 3) /2 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("No")
    exit()
   
  
print("Yes")

Submission status: Wrong Answer

Solution code:
def kaibun(s):
    flg = False
    if len(s) % 2 == 0:
        if s[0:int((len(s)/2))] == s[int(len(s)/2):len(s):-1]:
            flg =True
    else:
        
        if s[0:int((len(s)-1)/2)] == s[int((len(s)+1)/2):len(s)][::-1]:
            flg =  True
    return flg



s = input()
ans = "No"



if kaibun(s):
    if kaibun(s[0:int((len(s)-1)/2)]) and kaibun(s[int((len(s)+1)/2):len(s)]):
        ans = "Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
stra = input()

def hantei(s):
    for i in range(int(len(s) / 2)):
        if (s[i] != s[len(s) - 1 - i]):
            return False  
        if (int((len(s) + 3) / 2) + i < len(s) and s[int((len(s) + 3) / 2) + i] != s[len(s) - 1 - i]):
            return False

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

if(hantei(stra)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    N = len(S)
    a = S[0:int((N-1)/2)]
    b = S[int((N+3)/2)-1:N]
    if a == b:
        Na = len(a)
        aa = a[0:int((Na - 1) / 2)]
        ab = a[int((Na + 3) / 2)-1:Na]
        ma = a[len(aa)]

        Nb = len(b)
        ba = b[0:int((Nb - 1) / 2)]
        bb = b[int((Nb + 3) / 2)-1: Nb]
        mb = b[len(ba)]

        if aa == ba and aa == ab and ba == bb and ma == mb:
            print(YES)
        else:
            print(NO)
        return
    print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()

def check_if_kaibun(string):
  middle = int((len(string) - 1)  / 2)
  # print(string[0:middle])
  # print(string[middle + 1:])
  if (string[0:middle]) == (string[middle + 1:]):
    return True
  else:
    return False

a = int((len(S) - 1) / 2)
b = int((len(S) + 3) / 2)
# print(a, b)
  
if check_if_kaibun(S):
  # print(S[0:a])
  if check_if_kaibun(S[0:a]):
    # print(S[b-1:])
    if check_if_kaibun(S[b-1:]):
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

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


def rec(i, j):
    if(i == j or i > j):
        return 1
    if(S[i] != S[j]):
        return 0
    rec(i+1, j-1)


ans = rec(0, N-1)
ans = rec(0, int(-1+(N-1)/2))
ans = rec(int(-1+(N+3)/2), N-1)
if(ans == 0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
S = list(S)
S_1 = S[0:int((len(S)-1)/2)]
S_2 = S[int((len(S)-1)/2)+1:len(S)]
S_2.reverse()
if len(S) < 5:
    print('No')
else:
    if S_1 == S_2:
        if len(S_1) % 2 == 0:
            S_1_1 = S_1[0:int((len(S_1)-1)/2)+1]
            S_1_2 = S_1[int((len(S_1)-1)/2)+1:len(S_1)]
            S_2_1 = S_2[0:int((len(S_2)-1)/2)+1]
            S_2_2 = S_2[int((len(S_2)-1)/2)+1:len(S_2)]
        else:
            S_1_1 = S_1[0:int((len(S_1)-1)/2)]
            S_1_2 = S_1[int((len(S_1)-1)/2)+1:len(S_1)]
            S_2_1 = S_2[0:int((len(S_2)-1)/2)]
            S_2_2 = S_2[int((len(S_2)-1)/2)+1:len(S_2)]
        S_1_2.reverse()
        S_2_2.reverse()
        if S_1_1 == S_1_2:
            if S_2_1 == S_2_2:
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
import sys

s = input()
n= len(s)


"""
sが回文かどうかのチェック
"""
end = n
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()
    
"""
2つめチェック
"""
end = int((n-1)/2)
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()

"""
3つめチェック
"""
start=int((n+3)/2)-1
end = n
iteration=0
for i in range(start,end):
  head = s[i]
  tail = s[end-iteration-1]
  iteration+=1
  if head != tail:
    print('No')
    sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s2 = s[:int((n-1)/2)]
n2 = len(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)]
  b = s2[int(int((n2)/2)):]

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def check(string):
    if (string[::-1] == string):
        return True
    return False

string = input()
mid = int((len(string)-1)/2)

if check(string[:mid]) and check(string[mid+1:]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

def ispalindrome(s):
    h = int(len(s) / 2)
    for a, b in zip(s[:h], reversed(s[h+1:])):
        if a != b: return 0
    return 1

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

if ispalindrome(S) == 1:
  if ispalindrome(S[:index]) == 1:
    if len(S[:index]) >= 3:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

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

def isKaibun(s, length):
    flag = True
    if len(s) < 3:
        return False
    for i in range(int((length-1)/2)):
        if s[i] != s[length-1-i]:
            flag = False
            break
    return flag



orta = int((n+1)/2)-1

if isKaibun(s, n) and isKaibun(s[:orta], orta) and isKaibun(s[orta+1:], orta):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())
N=len(s)
tmp=s[0:int((N-1)/2)+1]
tmp_rev=tmp[::-1]

tmp2=s[int((N+3)/2)-1:]
tmp2_rev=tmp2[::-1]

if tmp==tmp_rev and tmp2==tmp2_rev and s==s[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
new_S = S[::-1]
front = S[:int(N//2)]
back = S[int((N+3)//2+1):]
new_front = front[::-1]
new_back = back[::-1]
if S == new_S and front == new_front and back == new_back:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
data = input()
S = [c for c in data]
S_inverse = list(reversed(S))

N = len(S)

print(S[: int((N - 1) / 2)])
print(S_inverse[int((N + 3) / 2 - 1):])
print(S_inverse[: int((N - 1) / 2)])
print(S[int((N + 3) / 2 - 1):])

if S != S_inverse:
    print("No1")
    exit(0)

if S[: int((N - 1) / 2)] != S_inverse[int((N + 3) / 2 - 1):]:
    print("No2")
    exit(0)

if S[int((N + 3) / 2 - 1):] != S_inverse[:int((N - 1) / 2)]:
    print("No3")
    exit(0)

print("Yes")

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_ = S1
pivot = len(S_)//2
S1_ = S_[:pivot]
S2_ = S_[pivot+1:][::-1]
if S1_ != S2_:
    print('No')
    exit()

N = len(S)
S_ = S2
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:
#coding:utf-8
s = input()
n = len(s)
half = (n-1)//2
half_1 = half // 2
m = n - (n+3)//2
l = (n+3)//2 -1
half_2 = m // 2

#sが回文か
if s[:half] != s[half+1:]:
    #print(s[:half], s[half+1:])
    print('No')
    exit()

elif half % 2 != 0 and s[:half_1] != s[half_1+1:half]:
    #print(half_1)
    #print(s[:half_1], s[half_1+1:half])
    print('No')
    exit()

elif half % 2 == 0 and s[:half_1] != s[half_1:half]:
    print('No')
    exit()

elif (m-1) % 2 != 0 and s[l:l+half_2] != s[l+half_2+1:]:
    #print(l+half_2)
    #print(s[l:l+half_2], s[l+half_2+1:])
    print('No')
    exit()

elif (m-1) % 2 == 0 and s[l:l+half_2] != s[l+half_2:]:
    print('No')
    exit()


print('Yes')

Submission status: Wrong Answer

Solution code:
def F(x):
    return x[0:len(x)//2] == x[::-1][0:len(x)//2]

s = input()
n = len(s)
if n%2==0:
    print('No')
    exit(0)
sf = s[0:(n-1)//2]
sb = s[(n+3)//2-1:]
if F(sf) and F(sb):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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


def f(s):
    n = len(s)
    if n % 2 == 0:
        return list(s[:n // 2]) == list(reversed(s[n // 2:]))
    else:
        return list(s[:n // 2]) == list(reversed(s[n // 2 + 1:]))


if f(s) and f(s[:(n - 1)//2]) and f(s[(n + 3) // 2:]):
    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)
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)
j3 = j3_str[:int((l3-1)/2)] == j3_str[int((l3-1)/2+1):]

if j1&j2&j3:
    ans = 'Yes'
else :
    ans = 'No'
print(ans)

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
    if n == 1:
        s1 = s[0]
        s2 = s[1]
    else:
        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:
import math
S=input()
N=len(S)
S1=S[0:math.floor((N-1)/2)]
S2=S[math.floor((N+3)/2)-1:N]
if S1==S1[::-1]:
  if S2==S2[::-1]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = (input())
#a,b = map(int,input().split())
n = len(s)
b = n//2
s1 = s[0:b]
s2 = s[b+1:]
#print(s1,s2)
if n == 3:
    if s[0] == s[-1]:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
        
flag1,flag2 = True,True
for i in range(len(s1)//2):
    if s1[i] == s1[-i-1]:
        flag1 = True
    else:
        flag1 = False
        break
for i in range(len(s2)//2):
    if s2[i] == s2[-i-1]:
        flag2 = True
    else:
        flag2 = False
        break
if flag1 and flag2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

S = input()
# print(S)

N = len(S)
# print(N)

def judge(N, S):
    bf = (N-1) // 2
    af = (N+3) // 2 - 1
    
    if S[:bf] == S[af:]:
        flg = True
    else:
        flg = False
    return flg

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

if S[:(N-1) // 2] == rev:
    b_S = S[:(N-1) // 2]
    a_S = S[(N+3) // 2 - 1:]
    if judge(len(b_S), b_S) == True and judge(len(a_S), a_S) == True:
        print("Yes")
    else:
        print("No")
    exit()
else:
    print("No")

Submission status: Wrong Answer

Solution code:

s = input()
n = len(s)

flag = True
# 回分チェック
if not s[:int(n/2)] == s[int(n/2)+1:]:
    flag = False

# 2チェック
chk = s[0:int((n-1)/2)]
len_ = len(chk)
if not chk[:int(len_/2)] == chk[int(len_/2)+1:]:
    flag = False
# 3チェック
chk = s[int((n+3)/2)-1:n]
len_ = len(chk)
if not chk[:int(len_/2)] == chk[int(len_/2)+1:]:
    flag = False

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

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
a = N % 4
ans = "Yes"
if N == 3:
    if S[0] != S[2]:
        ans = "No"
elif a == 1:
    x = (N - 1) / 4
    x = int(x)
    for i in range(x):
        if (S[i] != S[2 * x - i - 1]) or (S[2 * x + 1 + i] != S[N - 1 - i]):
            ans = "No"
elif a == 3:
    x = (N - 3) / 4
    x = int(x)
    for i in range(x):
        if (S[i] != S[2 * x - i]) or (S[2 * x + 2 + i] != S[N - 1 - i]):
            ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    s = input()
    if len(s) == 3:
        print("Yes")
        exit()
    s1 = s[:((len(s)-1)//2)]
    s2 = s[((len(s)+3)//2)-1:]
    rs1 = s1[::-1]
    rs2 =s2[::-1]
    if s1 == rs1 and s2 == rs2:
        print("Yes")
    else:
        print("No")
resolve()

Submission status: Wrong Answer

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

def circ_check(s):
    s_rev=s[::-1]
    n=len(s)
    print(s_rev[0:int((n-1)/2)],s[0:int((n-1)/2)])
    if s_rev[0:int((n-1)/2)] ==s[0:int((n-1)/2)]:
        s_check=1
    else:
        s_check=0
    return(s_check) 

    
if n%4==3:
    res1=circ_check(s)
    res2=circ_check(s[0:int((n-1)/2)])
    res3=circ_check(s[int((n-1)/2+1):len(s)])
    if res1*res2*res3==1:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

# -*- coding: utf-8 -*-

s = input()
count = len(s)

helfCount = int(count / 2 - 1)

ans = "Yes"

for x in range(0, helfCount):
    if s[x] != s[count - x - 1] :
        ans = "No"
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_kaibun(s):
    half = int(len(s) / 2) if len(s) % 2 == 0 else int((len(s) + 1) / 2)
    for i in range(half):
        if s[i] != s[-(i + 1)]:
            return False
        return True


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

Submission status: Wrong Answer

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

if s[0:math.floor(len(s)/2)] != s[math.ceil(len(s)/2):]:
  print('No')
  sys.exit()

if s[0:math.floor((len(s)-1)/4)] != s[math.ceil((len(s)-1)/4):math.floor((len(s)-1)/2)]:
  print('No')
  sys.exit()

j=-1
for i in range(math.floor((len(s)+3)/2-1),len(s)):
  if s[i] != s[j]:
    print('No')
    sys.exit()
  j -= 1

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
 
import math
M = math.floor((N-3)/2)
L = math.floor((N-3)/4)
 
a = 0
    
for i in range(M):
  if S[i] != S[N-i-1]:
    a = 1
    
if L % 2 == 0:
  p = math.floor((N-3)/8)
  for k in range(p-1):
    if S[k] != S[N-k-1]:
      a = 1
      
else:
  p = math.floor(((N-3)/4-1)/2)
  for k in range(p-1):
    if S[k] != S[N-k-1]:
      a = 1
    
if a == 0:
  print('Yes')
  
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()

def check(s):
    if len(s) == 1:
        return True

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
import sys

s = input()
n= len(s)


"""
sが回文かどうかのチェック
"""
end = n
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()
    
"""
2つめチェック
"""
end = int((n-1)/2-1)
for i in range(end):
  head = s[i]
  tail = s[end-i]
  if head != tail:
    print('No')
    sys.exit()

"""
3つめチェック
"""
start=int((n+3)/2-1)
end = n
iteration=0
for i in range(start,end):
  head = s[i]
  tail = s[end-iteration-1]
  iteration+=1
  if head != tail:
    print('No')
    sys.exit()

Submission status: Wrong Answer

Solution code:
s=input()
print('Yes' if s[:(len(s)-1)//2]==s[(len(s)-1)//2+1:][::-1]
               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]
      else '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)
    
    if length%2 == 0:
        print('No')
        exit()
    
    half = int((length-1)/2)
    if data_2[:half] == data_2[half+1:]:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

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


def rec(i, j):
    if(i == j or i > j):
        return 1
    if(S[i] != S[j]):
        return 0
    rec(i+1, j-1)


ans = rec(0, int(-1+(N-1)/2))
ans = rec(int(-1+(N+3)/2), N-1)
if(ans == 0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

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

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

print('Yes')

Submission status: Wrong Answer

Solution code:
from sys import stdin

s = str(stdin.readline().rstrip())
len_s = len(s)

half_a = s[0:int((len_s - 1)/2)]
half_b = s[:int((len_s - 1)/2):-1]

rev_s = s[::-1]

if half_a == half_b:
    if rev_s == s:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=input()

n=len(s)
h=(n-1)//2
hh=h//2
h3=(n+3)//2
h3h=(h3+n)//2

s1=s[:h]
s2=s[h+1:]
s3=s[:hh]
s4=s[hh+1:h]
s5=s[h3-1:h3h-1]
s6=s[h3h:]

f1=f2=f3=False
if s1==s2:
  f1=True
if s3==s4:
  f2=True
if s5==s6:
  f3=True

ans='Yes' if f1==f2==f3==True else 'No'
print(ans)

Submission status: Wrong Answer

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