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):
import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-1))]:
        c = False
if c:
    print("Yes")
else:
    print("No")

import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-i))]:
        c = False
if c:
    print("Yes")
else:
    print("No")

import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-1-i))]:
        c = False
if c:
    print("Yes")
else:
    print("No")

Verdicts: 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()
n=len(s)
if s[:(n-1)/2-1]==s[:(n-1)/2-1][::-1] and s==s[::-1]:
  print('Yes')
else:
  print('No')

s=input()
n=len(s)
if s[:(n-1)//2]==s[:(n-1)//2][::-1] and s==s[::-1]:
  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)
flag=0
S1=S[0:(n-1)//2-1]
S2=S[(n+3)//2+1:]
if S1==S1[::-1] and S2==S2[::-1]:
    pass
else:
    flag=1
print('Yes' if flag==0 else 'No')

S=input()
n=len(S)
flag=0
S1=S[0:(n-1)//2]
S2=S[(n+2)//2:]
if S1==S1[::-1] and S2==S2[::-1] and S==S[::-1]:
    pass
else:
    flag=1
print('Yes' if flag==0 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):
import math
import sys

s = input()
n= len(s)



end = n
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()
    

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


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


import math
import sys

s = input()
n= len(s)



end = n
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()
    

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


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


import math
import sys

s = input()
n= len(s)


end = math.ceil(n/2)
for i in range(end):
  head = s[i]
  tail = s[-i-1]
  if head != tail:
    print('No')
    sys.exit()
    

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


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


import math
import sys

s = input()
n= len(s)



end = n
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()
    

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


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

print('Yes')

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()
l = len(s)
s = list(s)
revs=s[::-1]



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


s =input()
l = len(s)
s = list(s)
revs=s[::-1]



if s[:int((l-1)/2)] == revs[-int((l-1)/2):] and s[int((l+2)/2):] == revs[:-int((l+2)/2)] and s == revs:
    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):
import math

def jds(strin):
    js = 0
    newSt = strin[::-1]
    if strin == newSt:
        js +=1
    return js
 
a = input()
jud = 0

leee = len(a)

if leee % 2 == 0:
    b = a[:math.ceil((len(a) - 1) / 2)]
    c = a[math.floor((len(a) + 1) / 2):]
else:
    b = a[:int((len(a) - 1) / 2)]
    c = a[int((len(a) + 2) / 2):]
 
jud += jds(a) + jds(b) + jds(c)
 
print(jud)
if jud == 3:
    print("Yes")
else:
    print("No")

import math

def jds(strin):
    js = 0
    newSt = strin[::-1]
    if strin == newSt:
        js +=1
    return js
 
a = input()
jud = 0

leee = len(a)

if leee % 2 == 0:
    b = a[:math.ceil((len(a) - 1) / 2)]
    c = a[math.floor((len(a) + 1) / 2):]
else:
    b = a[:int((len(a) - 1) / 2)]
    c = a[int((len(a) + 2) / 2):]
 
jud += jds(a) + jds(b) + jds(c)
 
#print(jud)
if jud == 3:
    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 checkKaibun(str):
    if len(str) % 2 == 1:
      return False
    for i in range(int((len(str) - 1) / 2)):
        if str[i] != str[-i - 1]:
            return False
    return True
 
s = input()
n = len(s)
c2e = int((n - 1) / 2)
c3s = int((n + 3) / 2) - 1
if not checkKaibun(s):
    print('No')
elif not checkKaibun(s[0:c2e]):
    print('No')
elif not checkKaibun(s[c3s:n]):
    print('No')
else :
    print('Yes')

def checkKaibun(str):
    for i in range(int(len(str) / 2)):
        if str[i] != str[-i - 1]:
            return False
    return True
 
s = input()
n = len(s)
c2e = int((n - 1) / 2)
c3s = int((n + 3) / 2) - 1
if not checkKaibun(s):
    print('No')
elif not checkKaibun(s[0:c2e]):
    print('No')
elif not checkKaibun(s[c3s:n]):
    print('No')
else :
    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()
sl=list(reversed(s))
ns="".join(list(reversed(s)))
k=(len(s)-1)/2
t=s[:k]
tl=list(reversed(t))
nt="".join(list(reversed(t)))
n=(len(s)+3)/2
r=s[n-1:len(s)]
rl=list(reversed(r))
nr="".join(rl)
if s==ns and t==nt and r==nr:
    print("Yes")
else:
    print("No")

s=input()
sl=list(reversed(s))
ns="".join(list(reversed(s)))
k=int((len(s)-1)/2)
t=s[:k]
tl=list(reversed(t))
nt="".join(list(reversed(t)))
n=int((len(s)+3)/2)
r=s[n-1:len(s)]
rl=list(reversed(r))
nr="".join(rl)
if s==ns and t==nt and r==nr:
    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)
A = int((N - 1) / 2)
B = int((A - 1) / 2)
X = 0

for i in range(A):
  if S[i] != S[-i-1]:
    X += 1

if N == 5:
  if S[0] != S[1]:
    X += 1

if N >= 7:
  for i in range(B):
  	if S[i] != S[A-1]:
    	X += 1
      
if X == 0:
  print("Yes")
else:
  print("No")

S = input()
N = len(S)
A = int((N - 1) / 2)
if A % 2 == 0:
  B = int(A / 2)
else:
  B = int((A - 1) / 2)
X = 0
 
for i in range(A):
  if S[i] != S[-i-1]:
    X += 1
 
if N >= 5:
  for i in range(B):
  	if S[i] != S[A-1-i]:
  	    X += 1
      
if X == 0:
  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):
L = int(input())/3
print(L**3)

s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

if flag:
    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)

tmp1, tmp2 = [], []
flag = 0
for i in range(int((N-1)/2)):
  tmp1.append(S[i])
for i in range(int((N+3)/2)):
  tmp2.append(S[-1-i])
#print(tmp1, tmp2)
if tmp1 == tmp2:
  flag = 1
  
if flag == 1:
  print('Yes')
else:
  print('No')

S = input()
N = len(S)

tmp1, tmp2 = [], []
flag = 0
for i in range(int((N-1)/2)):
  tmp1.append(S[i])
for i in range(int((N+3)/2)-1,N):
  tmp2.append(S[i])
#print(tmp1, tmp2)
if tmp1 == tmp2:
  flag = 1
  
if flag == 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()
a = s[:len(s)/2 -1]
b = s[len(s)+3/2-1:]
flag = 0
if s == s[::-1]:
    if a == a[::-1]:
        if b == b[::-1]:
            flag = 1

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


s  = input()
a = s[:int(len(s)/2)]
b = s[:-int(len(s)/2 + 1)]
flag = 0
if s == s[::-1]:
    if a == a[::-1]:
        if b == b[::-1]:
            flag = 1

if flag:
    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):
s1=input()
l=len(s1)
h=(l-1)//2
k1=s1[:h]
k2=s1[h+1:]
if k1==k2:
    a=(l-1)//2
    s3=s1[:a]
    if a%2!=0:
        h2=(a-1)//2
        j1=s3[:h2]
        j2=s3[h2+1:]
        if j1==j2:
            b=(l+3)/2
            b2=l-b+1
            s4=s1[:b2]
            h3=(b2-1)//2
            f1=s3[:h3]
            f2=s3[h3+1:]
            if f1==f2:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        h2=a/2
        j1=s3[:h2]
        j2=s3[h2+1:]
        if j1==j2:
            b=(l+3)/2
            b2=l-b+1
            s4=s1[:b2]
            h3=(b2-1)//2
            f1=s3[:h3]
            f2=s3[h3+1:]
            if f1==f2:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
else:
    print("No")

s = list(input())
n = len(s)
flag = 0
for i in range(n//2):
    if s[i] != s[n-i-1]:
        flag = 1
if flag == 0:
    s2 = s[:(n-1)//2]
    n2 = len(s2)
    for i in range(n2//2):
        if s2[i] != s2[n2-i-1]:
            flag = 1
#print(n, n2, s, s2)
if flag == 0:
    if flag == 0:
        s2 = s[(n+3)//2-1:]
        n2 = len(s2)
    for i in range(n2//2):
        if s2[i] != s2[n2-i-1]:
            flag = 1
#print(s2)
if flag == 0:
    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=str(input())
n=len(s)
new_n1=(n-1)/2
new_s1=s[:new_n]

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

for i in range(new_n1):
 if new_s1[i]!=new_s1[n-i+1]:
    print("No")
    exit()
 else:
  pass

for j in range(new_n2):
 if new_s2[j]!=new_s2[n-j+1]:
    prin("No")
 else
  print("Yes")
    

                    


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

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

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

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=str(input())

cnt=0

num=len(s)//2

a=s[:num]
b=s[num+1:]
print(a)
print(b)

num2=len(a)//2
c=a[:num2]
d=a[num2+1:]

print(c)
print(d)

num3=int((len(s)+3)/2-1)
s1=s[num3:]
num4=len(s1)//2
e=s1[:num4]
f=s1[num4+1:]

print(e)
print(f)

if a==b[::-1]:
    cnt +=1

if c==d[::-1]:
    cnt +=1

if e==f[::-1]:
    cnt +=1

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

s=str(input())

cnt=0

num=len(s)//2

a=s[:num]
b=s[num+1:]
print(a)
print(b)

num2=len(a)//2
if len(a)%2 ==1:
    c=a[:num2]
    d=a[num2+1:]
else:
    c=a[:num2]
    d=a[num2:]

print(c)
print(d)

num3=int((len(s)+3)/2-1)
s1=s[num3:]
num4=len(s1)//2
if len(s1)%2==1:
    e=s1[:num4]
    f=s1[num4+1:]
else:
    e=s1[:num4]
    f=s1[num4:]


print(e)
print(f)

if a==b[::-1]:
    cnt +=1

if c==d[::-1]:
    cnt +=1

if e==f[::-1]:
    cnt +=1

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

s=str(input())

cnt=0

num=len(s)//2

a=s[:num]
b=s[num+1:]

num2=len(a)//2
if len(a)%2 ==1:
    c=a[:num2]
    d=a[num2+1:]
else:
    c=a[:num2]
    d=a[num2:]


num3=int((len(s)+3)/2-1)
s1=s[num3:]
num4=len(s1)//2
if len(s1)%2==1:
    e=s1[:num4]
    f=s1[num4+1:]
else:
    e=s1[:num4]
    f=s1[num4:]


if a==b[::-1]:
    cnt +=1

if c==d[::-1]:
    cnt +=1

if e==f[::-1]:
    cnt +=1

if cnt==3:
    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):

import math
character = input()
re_character = character[::-1]
 
num = int(len(character))
middle = math.ceil(num/2.0)
print(middle)
#print(character[0:middle-1], re_character[middle:num])
#print(character[0:num], re_character[0:num])
#print (character[middle:num], re_character[0:middle-1])

if (character[middle:num] == re_character[0:middle-1]):
  if (character[0:num] == re_character[0:num]):
    print("Yes")
  else:
    print("No")
else:
  print("No")



import math
character = input()
re_character = character[::-1]
 
num = int(len(character))
middle = math.ceil(num/2.0)
#print(middle)
#print(character[0:middle-1], re_character[middle:num])
#print(character[0:num], re_character[0:num])
#print (character[middle:num], re_character[0:middle-1])

if (character[middle:num] == re_character[0:middle-1]):
  if (character[0:num] == re_character[0:num]):
    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 kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n/2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)/2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
S=input()
N=len(S)
if kaibun(S)==True and kaibun(S[0:(N-1)/2])==True and kaibun(S[(N+3)/2-1:N])==True:
  print("Yes")
else:
  print("No")

def kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n/2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)/2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
if kaibun(S)==True and kaibun(S[0:(len(S)-1)/2])==True and kaibun(S[(len(S)+3)/2-1:len(S)])==True:
  return "Yes"
else:
  return "No"

def kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n//2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)//2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
S=input()
N=len(S)
if kaibun(S)==True and kaibun(S[0:(N-1)//2])==True and kaibun(S[(N+3)//2-1:N])==True:
  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)

ans = 'No'
if S == S[::-1]:
    if S[:N//2] == S[N//2::-1]:
        ans = 'Yes'

print(ans)

S = input()
N = len(S)

ans = 'No'
if S == S[::-1]:
    if S[:N//2] == S[(N//2)-1::-1]:
        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()
a=S[:int((len(S)-1)/2)]
b=S[int((len(S)+3)/2)-1:]
c=''.join(list(reversed(a)))
d=''.join(list(reversed(b)))

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

S=input()
s=''.join(list(reversed(S)))
a=S[:int((len(S)-1)/2)]
b=S[int((len(S)+3)/2)-1:]
c=''.join(list(reversed(a)))
d=''.join(list(reversed(b)))
if S==s and a==c and b==d:
	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()
n=s
 
if s==reversed(s) and s[0:(n-1)//2]==reverses(s[0:(n-1)//2]) and s[((n+3)//2)-1:n]==reversed(s[((n+3)//2)-1:n]):
print("Yes")
 
else:
	print("No")

s=input()
n=len(s)
 
if s==reversed(s) and s[0:(n-1)//2]==reverses(s[0:(n-1)//2]) and s[((n+3)//2)-1:n]==reversed(s[((n+3)//2)-1:n]):
	print("Yes")

else:
	print("No")

s=input()
n=s

if s==reversed(s) and s[0:(n-1)//2]==reverses(s[0:(n-1)//2]) and s[((n+3)//2)-1:n] and reversed(s[((n+3)//2)-1:n]):
print("Yes")

else:
	print("No")

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:n]==s[((n+3)//2)-1:n:-1]:
	print("Yes")

else:
	print("No")

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

s=input()
n=s
 
if s==reversed(s) and s[0:(n-1)//2]==reverses(s[0:(n-1)//2]) and s[((n+3)//2)-1:n]==reversed(s[((n+3)//2)-1:n]):
	print("Yes")
 
else:
	print("No")

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

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()
message = "No"
if S == S[::-1]:
	index = int((len(S)-1)/2)
	test = S[:index]
	print(test)
	if test == test[::-1]:
		index = int((len(S)+3)/2)
		test = S[index-1:]
		print(test)
		if test == test[::-1]:
			message = "Yes"
print(message)


S = input()
message = "No"
if S == S[::-1]:
	index = int(((len(S)-1)-1)/2)
	print(index)
	test = S[:index+1]
	print(test)
	if test == test[::-1]:
		index = int(((len(S)-1)+3)/2)
		print(index)
		test = S[index:]
		print(test)
		if test == test[::-1]:
			message = "Yes"
print(message)


S = input()
message = "No"
if S == S[::-1]:
	index = (len(S)-1)//2
	test = S[:index]
	if test == test[::-1]:
		index2 = (len(S)+3)//2
		otest = S[index2-1:]
		if otest == otest[::-1]:
			message = "Yes"
print(message)


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(sl):
    for i in range(len(sl)):
        if sl[i] != sl[-1-i]:
            return 'No'
            break
        else:
            return 'Yes'


s = input()



sl = []
out = 'Yes'
slz = []
slk = []

for i in range(len(s)):
    sl.append(s[i])

for i in range((len(s)-1) // 2):
    slz.append(s[i])


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



    
    
out = kaibun(sl)
out = kaibun(slz)
out = kaibun(slk)
print(out)






def kaibun(sl):
    for i in range(len(sl)):
        if sl[i] != sl[-1-i]:
            return 'No'
            break
        else:
            return 'Yes'


s = input()



sl = []
out = 'Yes'
slz = []
slk = []

for i in range(len(s)):
    sl.append(s[i])

for i in range((len(s)-1) // 2):
    slz.append(s[i])


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


f = 'Yes'
    
    
if kaibun(sl) == 'No':
	f = 'No'

if kaibun(slz) == 'No':
	f = 'No'

if kaibun(slk) == 'No':
	f = 'No'

print(f)






def kaibun(sl):
	f = 'Yes'
	for i in range(len(sl)):
		if sl[i] != sl[-1-i]:
			f = 'No'
			break
	return f


s = input()



sl = []
slz = []
slk = []

for i in range(len(s)):
    sl.append(s[i])

for i in range((len(s)-1) // 2):
    slz.append(s[i])


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


f = 'Yes'
    
    
if kaibun(sl) == 'No':
	f = 'No'

if kaibun(slz) == 'No':
	f = 'No'

if kaibun(slk) == 'No':
	f = 'No'

print(f)






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 palindrome(S):
  for i in range(len(S)//2):
#    print(S[i],S[-(i+1)])
    if S[i] != S[-(i+1)]:
      return 0
  return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S1 = S[(len(S)+3)//2:]
if palindrome(S) == 1:
  if palindrome(S1) == 1:
    if palindrome(S2) == 1:
      ans == "Yes"
print(ans)

def palindrome(S):
  for i in range(len(S)//2):
#    print(S[i],S[-(i+1)])
    if S[i] != S[-(i+1)]:
      return 0
  return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S2 = S[(len(S)+3)//2:]
if palindrome(S) == 1:
  if palindrome(S1) == 1:
    if palindrome(S2) == 1:
      ans == "Yes"
print(ans)

def palindrome(S):
  for i in range(len(S)//2):
#    print(S[i],S[-(i+1)])
    if S[i] != S[-(i+1)]:
      return 0
  return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S2 = S[(len(S)+1)//2:]
print(palindrome(S))
print(palindrome(S1))
print(palindrome(S2))

if palindrome(S) == 1:
  if palindrome(S1) == 1:
    if palindrome(S2) == 1:
      ans = "Yes"
print(ans)

def palindrome(S):
  for i in range(len(S)//2):
#    print(S[i],S[-(i+1)])
    if S[i] != S[-(i+1)]:
      return 0
  return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S2 = S[(len(S)+1)//2:]




if palindrome(S) == 1:
  if palindrome(S1) == 1:
    if palindrome(S2) == 1:
      ans = "Yes"
print(ans)

Verdicts: Runtime Error

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()
A=list(s)
N=len(A)
M=N-1
k=0
while k<M/2:
  if A[k]!=A[M-k]:
    print("No")
  if A[k]!=A[(M-2)/2-k]:
    print("No")
  if A[k+M/2+1]!=A[M-k]:
    print("No")
  else:
    print("Yes")
  k=k+1

s=input()
A=list(s)
N=len(A)
M=N-1
R=M//2
k=0
while k<M/2:
  if A[k]!=A[M-k]:
    print("No")
  if A[k]!=A[R-1-k]:
    print("No")
  if A[k+R+1]!=A[M-k]:
    print("No")
  else:
    print("Yes")
  k=k+1

import sys
L=list(input())
N=len(L)
R=N//2
for i in range(R):
  if L[i]!=L[N-1-i]:
    print("No")
    sys.exit()
  elif L[i]!=L[R-1-i]:
    print("No")
    sys.exit()
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):
a = input()
n= len(a)
zenzen = a[0:n//2//2]
zenkou = a[n//2//2:n//2]
kouzen = a[n//2+1:n-1-n//2//2]
koukou = a[n-1-n//2//2]
new_zenkou = ''.join(list(reversed(zenkou)))
new_koukou = ''.join(list(reversed(koukou)))
if zenzen != new_zenkou:
  print('No')
  exit()
if kouzen != new_zenkou:
  print('No')
  exit()
print('Yes')

a = input()

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

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

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

if s==s[::-1] and top == top[::-1] and bottom = bottom[::-1]:
  print("Yes")
else:
  print("No")

s = input()
n = len(s)
top = s[: (n - 1) // 2]
bottom = s[(n + 3) // 2 - 1 :]

if s == s[::-1] and top == top[::-1] and bottom == bottom[::-1]:
    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 pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:(len(s)//2 - 1):]) and pal(s[(len(s)//2 + 1)::]);

if f == True:
  print("Yes");
else:
  print("No");


def pal(s):
  f = True;
  i = 0;
  l = s.size() - 1;
  while i < l - i:
    if s[i] != s[l - i]:
      f = false;
	i++;
  return f;

s = input();
f = pal(s) and pal(s[0:(n//2 - 1):]) and pal(s[(n//2 + 1)::]);
if f == True:
  print("Yes");
else:
  print("No");

def pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:len(s)//2:]) and pal(s[(len(s)//2 + 1)::]);

if f == True:
  print("Yes");
else:
  print("No");


Verdicts: 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()
if s==s[::-1] and s==s[:(len(s)−1)//2] and s==s[(len(s)+3)//2-1:]:
  print("Yes")
else:
  print("No")

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

s=input()
a=s[:(len(s)-1)//2]
b=s[((len(s)+3)//2-1):]
if s==s[::-1] and a==a[::-1] and b==b[::-1]:
  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()
K1=int((len(S)-1)/2)
K2=int((K1-1)/2)
K3=int((len(S)+3)/2)

#1
S_K1=S[:K1]
S_K1_r=S[:K1:-1]

#2
S_K2=S_K1[:K2]
S_K2_r=S_K1[:K2:-1]
#len(S_K2)>=3

#3
S_K3=S[K3-1:]
#len(S_K3)>=3
num3=int((len(S_K3)-1)/2)
S_K4=S_K3[:num3]
S_K4_r=S_K3[:num3:-1]

if S_K1==S_K1_r  and (S_K2==S_K2_r and len(S_K2)>2) and (S_K4 == S_K4_r and len(S_K3)>2):
  print('Yes')
else:
  print('No')

S=input()
N=len(S)
r_S=S[::-1]
c1=int((N-1)/2)
c2=int((N+3)/2)
S1=S[:c1]
r_S1=S1[::-1]
S2=S[(c2-1):]
r_S2=S2[::-1]



if S==r_S and S1==r_S1 and S2==r_S2:
  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()
n = len(s)
print(s, n)
i = int(((n-1)/2)-1)
j = int(((n+3)/2)-1)
#print(i, j)
l = s[:i+1]
l2 = l[::-1]
r = s[j:]
r2 = r[::-1]
#print(l, l2, r, r2)
if l == l2 and r == r2 and l == r:
  print('Yes')
else:
  print('No')

s = input()
S = s[::-1]
n = len(s)
#print(s, n)
i = int(((n-1)/2)-1)
j = int(((n+3)/2)-1)
#print(i, j)
l = s[:i+1]
l2 = l[::-1]
r = s[j:]
r2 = r[::-1]
#print(l, l2, r, r2)
if l == l2 and r == r2 and s == 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 = list(map(str, input()))
n = len(s)
res = True
for i in range(n//2):
    print("?")
    if (s[i] != s[n-1-i]):
        res = False
        break
i = 0
while res and i < n//4:
    print("!")
    if (s[i] != s[(n-1)//2-1-i]):
        res = False
        break
    i += 1
print("Yes" if res else "No")

s = list(map(str, input()))
n = len(s)
res = True
for i in range(n//2):
    if (s[i] != s[n-1-i]):
        res = False
        break
i = 0
while res and i < n//4:
    if (s[i] != s[(n-1)//2-1-i]):
        res = False
        break
    i += 1
print("Yes" if res 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()
ls = list(s)
print((len(ls)-1)/2 - 1)
ls1 = ls[:int((len(ls)-1)/2)]
ls2 = ls[int((len(ls)+3)/2) - 1:]
def kt(l):
    lr = list(reversed(l))
    if l == lr:
        return 1
    else:
        return 0
a = kt(ls)
b = kt(ls1)
c = kt(ls2)


d = a + b + c

if d >= 3:
    print('Yes')
else:
    print('No')


s = input()
ls = list(s)
ls1 = ls[:int((len(ls)-1)/2)]
ls2 = ls[int((len(ls)+3)/2) - 1:]
def kt(l):
    lr = list(reversed(l))
    if l == lr:
        return 1
    else:
        return 0
a = kt(ls)
b = kt(ls1)
c = kt(ls2)


d = a + b + c

if d >= 3:
    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()
n=len(S)
a=0
b=0
for i in range((n-1)/2):
	if S[i]!=S[n-i]:
    	a=1
        print("No")
        break;
p=""
q=""
if a==0:
	for i in range((n-1)/2):
		p.append(S[i])
    	q.append(S[i+1+(n-1)/2])
	for i in range((len(p)-1)/2):
  		if p[i]!=p[len(p)-i] or q[i]!=q[len(p)-i]:
        	b=1
            print("No")
            break;
if a==0 and b==0:
	print("Yes")


S=input()
n=len(S)
a=0
b=0
for i in range(1,int(n/2)+1):
    if S[i-1]!=S[n-i]:
        a=1
        print("No")
        break;
p=[]
q=[]
if a==0:
    for i in range(1,int(n/2)+1):
        p.append(S[i-1])
        q.append(S[i+int(n/2)])
    #print(p,q)
    for i in range(1,int((len(p))/2)+1):
        #print(p[i-1],p[len(p)-i],q[i-1],q[len(p)-i])
        if p[i-1]!=p[len(p)-i] or q[i-1]!=q[len(p)-i]:
            b=1
            print("No")
            break;
if a==0 and b==0:
    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()


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

print(s1, s2)
def reverse(s): 
    return s[::-1]

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

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


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

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

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

if isPalindrome(s):
    if n % 2 == 0:
        print("No")
    elif isPalindrome(s1) and isPalindrome(s2):
        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):
word=list(map.string().split())
check=True
for i in range(len(word)//2)
    if word[i]==word[len(word)-1]:
        continue:
    else:
          check=False
          braek:
if check==True:
    print("Yes")
else:
    print("No")

word=list(input())
check=True
for i in range(len(word)//2)
    if word[i]==word[len(word)-1]:
        continue:
    else:
          check=False
          braek:
if check==True:
    print("Yes")
else:
    print("No")


S=list(input())
N=len(S)
check=True
for i in range(N//2):
    if S[i]!=S[N-1-i]:
        check=False
        break
if check==False:
    print("No")
else:
    C=False
    for i in range((N//2)//2):
        if S[i]!=S[N//2-1-i]:#0123456
          C=True
          break
    if C==True:
        print("No")
    else:
        print("Yes")


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 = list(input())
N = len(S)
S0 = S[:(N - 1) // 2]
S1 = S[(N + 1) // 2:]
print(S0, S1, S)
if S0 == S0[::-1] and S1 == S1[::-1] and S == S[::-1]:
    print('Yes')
else:
    print('No')


S = list(input())
N = len(S)
S0 = S[:(N - 1) // 2]
S1 = S[(N + 1) // 2:]
if S0 == S0[::-1] and S1 == S1[::-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 = str(input())

slist = list(S)
N = len(slist)
print(N)
k = int((N-1)/2)

rs = slist[::-1]
front = slist[0:k]
rfront = front[::-1]

if front == rfront and rs == slist:
    print("Yes")

else:
    print("No")


S = str(input())

slist = list(S)
N = len(slist)
k = int((N-1)/2)

rs = slist[::-1]
front = slist[0:k]
rfront = front[::-1]

if front == rfront and rs == slist:
    print("Yes")

else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: We have N balls. The i-th ball has an integer A_i written on it.   For each k=1, 2, ..., N, solve the following problem and print the answer.    * Find the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.

Submission attempts (in order):
from collections import Counter

N = int(input())
a = list(map(int, input().split()))
cnts = Counter(a)

_sum = 0
for key,value in cnts.items():
    _sum +=  value*(value-1)//2

for ai in a:
    ans = _sum
    c = cnts.count(ai)
    ans -= c*(c-1)//2
    ans += (c-1)*(c-2)//2
    print(ans)


from collections import Counter

N = int(input())
a = list(map(int, input().split()))
cnts = Counter(a)

_sum = 0
for key,value in cnts.items():
    _sum +=  value*(value-1)//2

for ai in a:
    ans = _sum
    c = cnts[ai]
    ans -= c*(c-1)//2
    ans += (c-1)*(c-2)//2
    print(ans)


Verdicts: Runtime Error

Accepted
Problem: We have N balls. The i-th ball has an integer A_i written on it.   For each k=1, 2, ..., N, solve the following problem and print the answer.    * Find the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.

Submission attempts (in order):
import collections
from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

m = int(input())
a = list(map(int,input().split()))[:m]
c = collections.Counter(a)

memo = {}
rmemo = {}

for i in a:
    if not rmemo.get(i):
        print(rmemo[i])
        continue

    res = 0
    for k,v in c.items():
        if i == k: v -= 1
        
        if v >= 2:
            if not memo.get(v):
                memo[v] = combinations_count(v, 2)

            res += memo[v]
    rmemo[i] = res
    print(res)

import collections


m = int(input())
A = list(map(int,input().split()))[:m]
c = collections.Counter(A)
 
def hoge(n):
    return n * (n - 1) // 2

full = sum([ hoge(i) for i in c.values()])

for a in A:
    print(full - hoge(c[a]) + hoge(c[a]-1))


Verdicts: Runtime Error

Accepted
Problem: We have N balls. The i-th ball has an integer A_i written on it.   For each k=1, 2, ..., N, solve the following problem and print the answer.    * Find the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.

Submission attempts (in order):
import math

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

n = int(input())
a = [0]*n
a = list(map(int, input().split()))
map(lambda x: x-1, a)
ty=[0]*n

for i in range(0, n):
    ty[a[i]]+=1

s = 0

for i in range(0, n):
    if ty[i]>=2:
        s += comb(ty[i], 2, exact=True)

for k in range(0, n):
    if ty[a[k]]==2:
        print(s-1)
    elif ty[a[k]]>2:
        print(s-comb(ty[a[k]], 2, exact=True)+comb(ty[a[k]]-1, 2,exact=True))
    else:
        print(s)

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n = int(input())
a = [0]*n
a = list(map(int, input().split()))
map(lambda x: x-1, a)
ty=[0]*n

for i in range(0, n):
    ty[a[i]]+=1

s = 0

for i in range(0, n):
    if ty[i]>=2:
        s += comb(ty[i], 2)

for k in range(0, n):
    if ty[a[k]]==2:
        print(s-1)
    elif ty[a[k]]>2:
        print(s-comb(ty[a[k]], 2)+comb(ty[a[k]]-1, 2))
    else:
        print(s)

import random


def nC2(n):
    return int(n*(n-1)/2)

n = int(input())

a = [0]*n
a = list(map(int, input().split()))
a = [i-1 for i in a]

ty=[0]*n

for i in range(0, n):
    ty[a[i]]+=1

s = 0

for i in range(0, n):
    if ty[i]>=2:
        s += nC2(ty[i])

for k in range(0, n):
    if ty[a[k]]==2:
        print(s-1)
    elif ty[a[k]]>2:
        print(s-nC2(ty[a[k]])+nC2(ty[a[k]]-1))
    else:
        print(s)

Verdicts: Runtime Error

Runtime Error

Accepted