TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-22 20:59:36 +0900
# LastModified: 2020-03-22 21:24:32 +0900
#


import os
import sys


def main():
    S = input()
    N = len(S)
    S_b = S[:(N-1)//2]
    S_a = S[(N+3)//2:]
    for i in range((N+1)//2-1):
        if S[i]!=S[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_b)+1)//2):
        if S_b[i]!=S_b[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_a)+1)//2):
        if S_a[i]!=S_b[-i]:
            print("No")
            return 
    print("Yes")



if __name__ == "__main__":
    main()


#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-22 20:59:36 +0900
# LastModified: 2020-03-22 21:36:47 +0900
#


import os
import sys


def main():
    S = input()
    N = len(S)
    S_b = S[:(N-1)//2]
    S_a = S[(N+1)//2:]
    for i in range((N+1)//2-1):
        if S[i]!=S[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_b)+1)//2):
        if S_b[i]!=S_b[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_a)+1)//2):
        if S_a[i]!=S_b[-i]:
            print("No")
            return 
    print("Yes")



if __name__ == "__main__":
    main()


#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-22 20:59:36 +0900
# LastModified: 2020-03-22 22:25:25 +0900
#


import os
import sys


def main():
    S = input()
    N = len(S)
    S_b = S[:(N-1)//2]
    S_a = S[(N+1)//2:]
    for i in range((N+1)//2-1):
        if S[i]!=S[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_b)+1)//2):
        if S_b[i]!=S_b[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_a)+1)//2):
        if S_a[i]!=S_b[-(i+1)]:
            print("No")
            return 
    print("Yes")



if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Wrong Answer

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

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


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

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


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


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


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


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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S = list(input())
n = (len(S)-1)//2
for i in range(n):
  if S[i] == S[-(i+1)] and S[i] == S[i+n+1]:
    continue
  else:
    print('No')
for i in 
print('Yes')

S = list(input())
n = (len(S)-1)//2
m = 0
for i in range(n):
  if S[i] == S[-(i+1)] and S[i] == S[i+n+1]:
    continue
  else:
    print('No')
    m = 1
    break
if m < 1:
  print('Yes')

Verdicts: Runtime Error

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

Submission attempts (in order):

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

    str1 = ""  
    for ele in s:  
        str1 += ele   
   
    return str1   
    
s=input()
n = len(s)
p=int(round((n-1)/2))
q=int(round((n+3)/2))
ans = isPalindrome(s)
print(ans)

t1=[]
t2=[]

for i in range(0,p):
    t1.append(s[i])
for i in range(q-1,n):
    t2.append(s[i])    
print(t1,t2)
ans1=isPalindrome(listToString(t1))
ans2=isPalindrome(listToString(t2))
if (ans==1 and ans1==1 and ans2==1):
    print ("Yes")
    
else:
    print("No")
   


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

    str1 = ""  
    for ele in s:  
        str1 += ele   
   
    return str1   
    
s=input()
n = len(s)
p=int(round((n-1)/2))
q=int(round((n+3)/2))
ans = isPalindrome(s)


t1=[]
t2=[]

for i in range(0,p):
    t1.append(s[i])
for i in range(q-1,n):
    t2.append(s[i])    

ans1=isPalindrome(listToString(t1))
ans2=isPalindrome(listToString(t2))
if (ans==1 and ans1==1 and ans2==1):
    print ("Yes")
    
else:
    print("No")
   

Verdicts: Wrong Answer

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

Submission attempts (in order):
text = str(input())
n = len(text)
target = (n-1)//2
 
print(target)
 
bef = text[:target]
aft = text[target+1:]

 
if bef == aft:
  print("Yes")
else:
  print("No")

text = str(input())
n = len(text)
target = (n-1)//2

print(target)

bef = text[:target]
aft = text[target+1:]
tfa = aft[::-1]

if bef == tfa:
  print("Yes")
else:
  print("No")

text = str(input())
n = len(text)
target = (n-1)//2
 
bef = text[:target]
aft = text[target+1:]
 
if bef == aft:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Wrong Answer

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

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



s = input()
ans = "No"



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

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)

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
t = s[:int(len(s)/2)]
if t == s[int(len(s)/2-1)::-1] :
    if t[:int(len(s)/2)] == t[int(len(s)/2-1)::-1] :
        print('yes')
else :
    print('no')


s = input()
t = s[:int(len(s)/2)]
if t == s[int(len(s)/2-1)::-1] :
    if t[:int(len(s)/2)] == t[int(len(s)/2-1)::-1] :
        print('yes')
else :
    print('no')


s = input()
n1 = int(len(s)/2)
n2 =  int(n1/2)
t1 = s[:n1]
t2 = s[::-1][:n1]
if t1 == t2 and t1[:n2] == t1[::-1][:n2] and t2[:n2] == t2[::-1][:n2] :
    print('Yes')
else :
    print('No')


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S=input()
N=len(S)
cnt=0
cnt1=0
cnt2=0
for i in range (N):
    if S[i]==S[N-1-i]:
        cnt+=1
 
if cnt==N:
    for j in range((N-1)//2):
        if  S[j]==S[(N-1)//2 -1-j]:
            cnt1+=1
    if cnt1==(N-1)//2:
        for k in range((N-1)//2):
            if S[(N+3)//2 -1+k]==S[N-1-k]:
                cnt2+=1
    else:
        print("No")
		exit()
    if cnt2==(N-1)//2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

S=input()
N=len(S)
cnt=0
cnt1=0
cnt2=0
for i in range (N):
    if S[i]==S[N-1-i]:
        cnt+=1

if cnt==N:
    for j in range((N-1)//2):
        if  S[j]==S[(N-1)//2 -1-j]:
            cnt1+=1
    if cnt1==(N-1)//2:
        for k in range((N-1)//2):
            if S[(N+3)//2 -1+k]==S[N-1-k]:
                cnt2+=1
    else:
        print("No")
        exit()
    if cnt2==(N-1)//2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Verdicts: Runtime Error

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

Submission attempts (in order):

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()


def main():
    s = input()
    sr = s[::-1]

    N = int(len(s))
    s1 = s[:int((N-1)/2)]
    s1r = s1[::-1]
    s2 = s[int((N+1)/2):]
    s2r = s2[::-1]

    # print(s1)
    #     # print(s1r)
    #     # print(s2)
    #     # print(s2r)
    #     # # return

    for i in range(len(s)-1):
        if s[i] != sr[i]:
            print("No")
            return

    for i in range(len(s1)-1):
        if s1[i] != s1r[i]:
            print("No")
            return

    for i in range(len(s2)-1):
        if s2[i] != s2[i]:
            print("No")
            return

    print("Yes")


if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

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

Submission attempts (in order):

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")



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")


#999999999 999999999



Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
m = (len(s) - 1) / 2
l = s[:m]
r = s[(len(s) + 3) / 2 - 1:]


def check(s):
    mid = len(s) // 2
    left = s[:mid]
    right = s[mid+1:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")


s = input()
m = (len(s) - 1) // 2
l = s[:m]
r = s[(len(s) + 3) // 2 - 1:]


def check(s):
    mid = len(s) // 2
    if len(s) % 2 != 0:
        left = s[:mid]
        right = s[mid+1:]
    else:
        left = s[:mid]
        right = s[mid:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

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

Submission attempts (in order):
def is_p(s):
    return s == s[::-1]
s = input()
n = len(s)
l, r = (n - 1)//2, l + 1
print('Yes' if is_p(s) and is_p(s[:l]) and is_p(s[r:]) else 'No')

def is_p(s):
    return s == s[::-1]
s = input()
l = (len(s) - 1)//2
r = l + 1
print('Yes' if is_p(s) and is_p(s[:l]) and is_p(s[r:]) else 'No')

Verdicts: Runtime Error

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

Submission attempts (in order):
s=input()
n=len(s)
if s[0]==s[(n-3)/2] and s[(n+1)/2]==s[n-1]:
  print ('Yes')
else:
  print('No')

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


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


s=input()
a=s[:len(s)//2]
b=s[(len(s)//2)+2:]
if a==a.reverse() and b==b.reverse():
  print('Yes')
else:
  print('No')

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


s=input()
a=s[:len(s)//2]
b=s[(len(s)//2)+1:]
if a!=b:
  print('No')
elif a==reversed(a) and b==reversed(b):
  print('Yes')
else:
  print('No')


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


s=input()
ans='No'
if s==s[::-1]:
  t=s[:len(s)//2]
  if t==t[::-1]:
    u=s[len(s)//2+1:]
    if u==u[::-1]:
      ans='Yes'
print(ans)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

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

Submission attempts (in order):
S = input()
L=len(S)
ans='No'
for i in S:
    if S==S[::-1] and S[:(L-1)/2+1]==S[(L-1)/2+1::-1] and S[L+3/2:]==S[:(L+3/2)-1:-1]:
    ans='Yes'
print(ans)

S = input()
L=len(S)
ans='No'
for i in S:
    if S[:(L-1)/2+1]==S[(L-1)/2+1::-1] and S[L+3/2:]==S[:(L+3/2)-1:-1]:
    ans='Yes'
print(ans)

S = input()
L=len(S)
ans='No'
    if S[:(L-1)/2]==S[(L-1)/2-1::-1] and S[L+3/2-1:]==S[:(L+3/2)-2:-1]:
    ans='Yes'
print(ans)

S = input()
L=len(S)
ans='No'
    if S[:(L-1)/2+1]==S[(L-1)/2-1::-1] and S[L+3/2:]==S[:(L+3/2)-2:-1]:
    ans='Yes'
print(ans)

S = input()
L=len(S)
ans=0
S1=S[:(L-1)//2]
S2=S[((L+3)//2)-1:]
if (S==S[::-1]) & (S1==S1[::-1]) & (S2==S2[::-1]):
    ans='Yes'
else:
    ans='No'
print(ans)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")

a=input()
#b=reversed(a)
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")

Verdicts: Runtime Error

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

Submission attempts (in order):
S = input()
if len(S) < 7:
	print("No")
	exit()
for i in range(len(S)//2):
	if S[i] != S[-i-1]:
		print("No")
		exit()
S_front = S[:(len(S)//2)]
print(S_front)
for i in range(len(S_front)//2):
	if S_front[i] != S_front[-i-1]:
		print("No")
		exit()
S_back = S[(len(S)+1)//2:]
print(S_back)
for i in range(len(S_back)//2):
	if S_back[i] != S_back[-i-1]:
		print("No")
		exit()
print("Yes")

S = input()
for i in range(len(S)//2):
	if S[i] != S[-i-1]:
		print("No")
		exit()
S_front = S[:(len(S)//2)]
for i in range(len(S_front)//2):
	if S_front[i] != S_front[-i-1]:
		print("No")
		exit()
S_back = S[(len(S)+1)//2:]
for i in range(len(S_back)//2):
	if S_back[i] != S_back[-i-1]:
		print("No")
		exit()
print("Yes")

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
S2 = S[:(len(S)-1)//2]
S3 = S[(len(S)+3)//2-1:]
print(S2, S3)
print("Yes" if S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1] else "No")

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = list(input())
j = -1

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

    j -= 1

print('Yes')


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')

s = list(input()) 
l = len(s) # l = 29
j = l - 1 # j = 28

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


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

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

print('Yes')

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

s=input()
print(s)
n=(len(s))
left=s[0:(n-1)//2]
right=s[((n+3)//2-1):]
if left!=right:
  print('No')
if is_kaibun(s):
  if is_kaibun(left):
    if is_kaibun(right):
      print('Yes')
    else:
      print('No')
  else:
     print('No')
else:
  print('No')      
    
    
  



  
    
 

   

  

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))
left=s[0:(n-1)//2]
right=s[((n+3)//2-1):]

if is_kaibun(s):
  if is_kaibun(left):
    if is_kaibun(right):
      print('Yes')
    else:
      print('No')
  else:
     print('No')
else:
  print('No')      
    

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = list(input())
N = len(s)
for i in range(N-1):
  if s[i]=s[N-1-i] and s[i]=s[(N-1)/2-1-i] and s[(N+3)/2-1+i]=s[N-1-i]:
    print("Yes")
  else:
    print("No")

s = list(input())
N = len(s)
c=0
for i in range(N-1):
  if s[i] != s[N-1-i]:
    c+=1

for i in range(N-1):
  if s[i] != s[(N-1)/2-1-i]:
    c+=1
    
for i in range(N-1):
  if s[(N+3)/2-1+i] != s[N-1-i]:
    c+=1

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


s = list(input())
N = len(s)
c=0
for i in range(N-1):
  if s[i]=s[N-1-i] and s[i]=s[(N-1)/2-1-i] and s[(N+3)/2-1+i]=s[N-1-i]:
    c+=1
    
if c == N:
  print("Yes")
else:
  print("No")

s = list(input())
n = (len(s)+1)//2
m = n//2
  if s[:n-1] == s[len(s):n-1:-1] and s[:m-1] == s[n-2:m-1:-1]:
    print("Yes")
  else:
    print("No")

s = input()
N = len(s)
c=0
for i in range(N-1):
  if s[i]==s[N-1-i] and s[i]==s[(N-1)/2-1-i] and s[(N+3)/2-1+i]==s[N-1-i]:
    c+=1
    
if c == N:
  print("Yes")
else:
  print("No")


s = list(input())
N = len(s)
c=0
for i in range(N-1):
  if s[i]==s[N-1-i] and s[i]==s[(N-1)/2-1-i] and s[(N+3)/2-1+i]==s[N-1-i]:
    c+=1
    
if c == N:
  print("Yes")
else:
  print("No")


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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
s=input()
n=len(s)
a=int(n/2)
s1a=s[0:a]
s2a=s[n-a:n]
s2=s[::-1]
s1b=s1a[::-1]
s2b=s2a[::-1]
print(s,s2,s1a,s1b,s2a,s2b)
if s==s2 and s1a==s1b and s2a==s2b:
	print("Yes")
else:
	print("No")


s=input()
n=len(s)
a=int(n/2)
s1a=s[0:a]
s2a=s[n-a:n]
s2=s[::-1]
s1b=s1a[::-1]
s2b=s2a[::-1]
if s==s2 and s1a==s1b and s2a==s2b:
	print("Yes")
else:
	print("No")


Verdicts: Wrong Answer

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

Submission attempts (in order):
S=input()
L=len(S)
count=0
for i in range(L//2):
	print(S[i],S[-i-1])
	if S[i] == S[-i-1]:
		count+=1
	else:
		print("No")
		exit()

Sa=S[:(L-1)//2]
Sb=S[(L+3)//2-1:(L+1)]
La=len(Sa)
Lb=len(Sb)

for j in range(La//2):
	print(Sa[j],Sa[-j-1])
	if Sa[j] == Sa[-j-1]:
		count+=1
	else:
		print("No")
		exit()
        
for k in range(Lb//2):
	if Sb[k] == Sb[-k-1]:
		count+=1
	else:
		print("No")
		exit()
print("Yes")

S=input()
L=len(S)
count=0
for i in range(L//2):
	if S[i] == S[-i-1]:
		count+=1
	else:
		print("No")
		exit()

Sa=S[:(L-1)//2]
Sb=S[(L+3)//2-1:(L+1)]
La=len(Sa)
Lb=len(Sb)

for j in range(La//2):
	if Sa[j] == Sa[-j-1]:
		count+=1
	else:
		print("No")
		exit()
        
for k in range(Lb//2):
	if Sb[k] == Sb[-k-1]:
		count+=1
	else:
		print("No")
		exit()
print("Yes")

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()

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

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

S = input()

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

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

print(S, S1, S2)

S = input()

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

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

S = input()

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

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

S = input()

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

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


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
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)


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')

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 - 1) // 2 + 1: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(s, n)
print(first_s_list, first_r_list)
print(last_s_list, last_r_list)

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 - 1) // 2 + 1: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')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
s = input()

def palind(word):
    l = len(word)
    i=0
    j=l-1 
    while i <= j:
        if word[i] != word[j]:
            return False
        i += 1
        j -= 1
    return True

n = len(s)

if palind(s) and palind(s[:(((n-1)//2))]) and palind(s[(((n+3)//2)-1):]):
    print("YES")
else:
    print("NO")

s = input()

def palind(word):
    l = len(word)
    i=0
    j=l-1 
    while i <= j:
        if word[i] != word[j]:
            return False
        i += 1
        j -= 1
    return True

n = len(s)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N=list(str(input()))
a=len(N)
if N[0]==N[(a-1)/2] and N[a]==N[(a+3)/2]:
  print("yes")
else:
  print("No")

S=list(map(str,input()))
if S[0]==S[int((len(S)-1)/2-1)] and S[:int((len(S)-1)/2)]==S[int((len(S)+1)/2):]:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

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

Submission attempts (in order):
s = input()

N = len(s)
if s==s[::-1] and s[:(N-1)//2]==s[:(N-1)//2][::-1] \
                            and s[(N+3)//2:N]==s[(N+3)//2:N][::-1]:
    print("Yes")
else:
    print("No")

s = input()

N = len(s)
if s==s[::-1] and s[:(N-1)//2]==s[:(N-1)//2][::-1] \
                            and s[(N+3)//2-1:]==s[(N+3)//2-1:][::-1]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

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

Submission attempts (in order):

def kaibuncheck(S):
    N=len(S)
    N_val=N-1
    center=int((N-1)/2)
    checkpoint=0
    for i in range(center-1):
        if S[i] == S[N_val]:
            checkpoint+=1
        N_val -= 1

    if checkpoint == center-1:
        return 1
    else:
        return 0

S = list(input())
N = len(S)
N2 = int((N-1)/2)

S_start=list()
S_end=list()
for i in range(N2):
    S_start.append(S[i])
    S_end.append(S[N-1-i])

print(S_start)
print(S_end)

if kaibuncheck(S) == 1 and kaibuncheck(S_start) == 1 and kaibuncheck(S_end) == 1:
    print('Yes')
else:
    print('No')



def kaibuncheck(S):
    N=len(S)
    if N == 1:
        return 1

    N_val=N-1
    center=int((N-1)/2)
    checkpoint=0
    if N == 1:
        return 1
    for i in range(center-1):
        if S[i] == S[N_val]:
            checkpoint+=1
        N_val -= 1

    if checkpoint == center-1:
        return 1
    else:
        return 0

S = list(input())
N = len(S)
N2 = int((N-1)/2)

S_start=list()
S_end=list()
for i in range(N2):
    S_start.append(S[i])
    S_end.append(S[N2+1+i])

if N%2 == 1:
    if kaibuncheck(S) == 1 and kaibuncheck(S_start) == 1 and kaibuncheck(S_end) == 1:
        print('Yes')
    else:
        print('No')
else:
    print('No')


Verdicts: Wrong Answer

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

Submission attempts (in order):
def is_kaibun(st):
  f = True
  for x,y in zip(st, st[::-1]):
    if x != y:
      f = False
      break
  return f

S = input()
ans = False
if is_kaibun(S):
  if is_kaibun(S[:(len(S)-1)/2+1]):
    ans = is_kaibun(S[(len(S)+3)/2+1])
if ans:
  print('Yes')
else:
  print('No')
  

def is_kaibun(st):
  f = True
  for x,y in zip(st, st[::-1]):
    if x != y:
      f = False
      break
  return f
 
S = input()
ans = False
if is_kaibun(S):
  if is_kaibun(S[:(len(S)-1)//2]):
    ans = is_kaibun(S[(len(S)+3)//2-1:])
if ans:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

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

Submission attempts (in order):
S = input()
N = len(S)


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


S = input()
N = len(S)


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

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
S=input()
T=S[:N//2]
U=S[N//2+1:]
N=len(S)
flg=0
for i in range(int((N-1)/2)):
  if(S[i]!=S[-i]):
    break
  flg+=1

for j in range(len(T)//2):
  if(T[j]!=T[-j]):
    break
  flg+=1

for k in range(len(U)//2):
  if(U[k]!=U[-k]):
    break
  flg+=1

if(flg==3):
  print("Yes")
else:
  print("No")

S=input()
T=S[:N//2]
U=S[N//2+1:]
N=len(S)
flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    print(S[i],S[-i])
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")

S=input()
N=len(S)
T=S[:N//2]
U=S[N//2+1:]

flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
S = input()
N = len(S)

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

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

S = input()
N = len(S)

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

bck = S[int((N+1)/2) : N]

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
S=input()
for i in range(len(S)//4):
    print(i)
    if not S[i]==S[-i-len(S)//2-2]==S[i+len(S)//2+1]==S[-i-1]:
        exit()
print("Yes")

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
N = len(S) 
ans = ""
for i in range(N):
    if S[0 + i] == S[(N - 1) - i]:
        ans = "Yes"
        if S[0 + i] == S[((N - 1) // 2) - 1 - i]:
            ans = "Yes"
        else:
            ans = "No"
            break
            if S[((N + 3) // 2) - 1 - i] == S[(N - 1) - i]:
                ans = "Yes"
            else:
                ans = "No"
                break
    else:
        ans = "No"
        break
print(ans)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
s=input()
n=len(s)+1
a=s[0:int((n-1)/2)]
b=s[int((n+3)/2)-1:n-1]
print(a,b)
if a==b:
  print('Yes')
else:
  print('No')

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
n, m = map(int, input().split())
a = list(input().split())

for i in range(len(a)):
    n = n - int(a[i])

if n >= 0:
    print(n)
else:
    print(-1)


s = str(input())

def check(text):
    n = len(text)
    if n == 1:
        return True

    left = int((n-1)/2)
    right = int((n+3)/2 - 1)

    print(text[0:left], text[right:n])
    if len(text[0:left]) == len(text[right:n]):
        if text[0:left] == text[right:n] and check(text[0:left]):
            return True
    else:
        if text[0:left] == text[right+1:n] and check(text[0:left]):
            return True
    return False

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


s = str(input())

def check(text):
    n = len(text)
    if n == 1:
        return True

    left = int((n-1)/2)
    right = int((n+3)/2 - 1)

    print(text[0:left], text[right:n])
    if len(text[0:left]) == len(text[right:n]):
        if text[0:left] == text[right:n] and check(text[0:left]):
            return True
    else:
        if text[0:left] == text[right+1:n] and check(text[0:left]):
            return True
    return False

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


def isKaibun(str):
    for i in range(len(str)):
        if str[i] != str[len(str)-i-1]:
            return False
    return True

s = input()

if not isKaibun(s):
    print("No")
elif not isKaibun(s[0:int((len(s) - 1) / 2)]):
    print("No")
elif not isKaibun(s[int((len(s) + 3) / 2)-1:len(s)]):
    print("No")
else:
    print("Yes")


Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
S = list(input())
N = len(S)
print((N-1)/2)
if S[:int((N-1)/2)] == list(reversed(S[:int((N-1)/2)])) and S[int((N+1)/2):] == list(reversed(S[int((N+1)/2):])):
    print('Yes')
else:
    print('No')

S = list(input())
N = len(S)
if S[:int((N-1)/2)] == list(reversed(S[:int((N-1)/2)]))\
    and S[int((N+1)/2):] == list(reversed(S[int((N+1)/2):]))\
    and S == list(reversed(S)):

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
l = len(S)

count = 0
harf = int(l/2)
a = S[:harf]
b = S[harf+1:][::-1]

print(a,b)

if a == b :
    count+=1

l = int((l-1)/2)
a = S[:l]
l1_harf = int(len(a)/2)
a1 = a[:l1_harf]
a2 = a[l1_harf+1:][::-1]

print(a,a1,a2)

if a1==a2:
    count+=1

l2 = int((l+3)/2)+1
b = S[:l2]
l2_harf = int(len(b)/2)
b1 = b[:l2_harf]
b2 = b[l2_harf+1:][::-1]

print(b,b1,b2)

if b1 == b2:
    count += 1

if count == 3:
    print("Yes")
else:
    print("No")

S = input()
l = len(S)

count = 0
harf = int(l/2)
a = S[:harf]
b = S[harf+1:][::-1]

print(a,b)

if a == b :
    count+=1

l = int((l-1)/2)
a = S[:l]
l1_harf = int(len(a)/2)
a1 = a[:l1_harf]
a2 = a[l1_harf+1:][::-1]

print(a,a1,a2)

if a1==a2:
    count+=1

l2 = int((l+3)/2)
b = S[l2:l]
l2_harf = int(len(b)/2)
b1 = b[:l2_harf-1]
b2 = b[l2_harf+1:][::-1]

print(l2,l2_harf,b,b1,b2)

if b1 == b2:
    count += 1

if count == 3:
    print("Yes")
else:
    print("No")

def kaibun(S):
    N = len(S)
    harf = int(N / 2)
    if harf != 0:
        a = S[:harf]
        b = S[-harf:][::-1]
    else:
        a = S[:1]
        b = S[-1:][::-1]
    return a,b

S = input()
flag = 0
a,b = kaibun(S)
if a == b:
    a1,a2 = kaibun(a)
    if a1 == a2:
        b1,b2 = kaibun(b)
        if b1 == b2:
            flag = 0
        else:
            flag = 1
    else:
        flag = 1
else:
    flag = 1

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
s = input()

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

ret = is_palindrome( s ) 
ret &= is_palindrome( s[:(len(s)-1)//2 ] ) 
ret &= is_palindrome( s[ (len(s)+3)//2-1: ] )
print( ret )

s = input()
 
def is_palindrome( s ):
  for i in range( len( s ) // 2 ):
    if s[i] != s[-i-1]:
      return False
  return True
 
ret = is_palindrome( s ) 
ret &= is_palindrome( s[:(len(s)-1)//2 ] ) 
ret &= is_palindrome( s[ (len(s)+3)//2-1: ] )
if ret:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted