TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
a=str(input())
a=list(a)
count=0
if len(a)%2 == 0:
  for i in range(0,int(len(a)/2)):
    if a[i]==a[len(a)-i-1]:
      count=count+1
else:
  for i in range(0,int(len(a)/2)):
    if a[i]==a[len(a)-i-1]:
      count=count+1
  
print(count)

a=str(input())
a=list(a)
count=0
if a%2 == 0:
  for i in range(0,int(a/2)):
    if a[i]==a[len(a)-i-1]:
      count=count+1
else:
  for i in range(0,int(a/2)):
    if a[i]==a[len(a)-i-1]:
      count=count+1
  
print(count)

a=str(input())
a=list(a)
count=0
for i in range(0,int(len(a)/2)):
    if a[i]!=a[len(a)-i-1]:
        count=count+1
  
print(count)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
ch = input()
chlen = len(ch)
num = 0

if(chlen%2 == 0 ):
  tyousei = 1
else:
  tyousei = 0

for i in range(int(chlen/2)+tyousei):
  if(ch[i-1] != ch[-i]):
    print(ch[i-1],ch[-i])
    num+=1
print(num)

ch = input()
chlen = len(ch)
num = 0

for i in range(int(chlen/2)):
  if(ch[i] != ch[chlen-i-1]):
    num+=1
print(num)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

cnt = 0
for i in range(S // 2):
  if S[i] != S[len(S) - 1 - i]:
    cnt +=0
print(cnt)
  
  

S = input()
 
cnt = 0
for i in range(len(S) // 2):
  if S[i] != S[len(S) - 1 - i]:
    cnt += 1
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = str(input())
s2 = s[::-1]
count = 0
for i in range(len(s)):
    if not (s[i]==s2[i]):
        count +=1

print(count)

s = str(input())
s2 = s[::-1]
count = 0
for i in range(len(s)//2):
    if not(s[i]==s2[i]):
        count +=1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S=input()
N=len(S)
if N%2==0:
  N=int(N/2)
else:
  N=int((N-1)/2)
ans=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    ans+=1
print(ans)

S=input()
N=len(S)
if N%2==0:
  N=int(N/2)
else:
  N=int((N+1)/2)
ans=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    ans+=1
print(ans)

S=input()
T=S[::-1]
cnt=0
for i in range(len(S)//2):
  if S[i]==T[i]:
    pass
  else:
    cnt+=1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = list(input())
n = len(s)
a = 0
for i in range(n//2):
  if s[i] != s[-i]:
    a += 1
print(a)

s = list(input())
n = len(s)
a = 0
for i in range(n//2):
  if s[i] != s[-i-1]:
    a += 1
print(a)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S=str(input())
T=S[::-1]
N=len(S)
count=0
for i in range(N):
  if S[i]!=T[i]:
    count+=1
print(count/2)


S=str(input())
T=S[::-1]
n=len(S)
count=0
for i in range(n):
  if S[i]!=T[i]:
    count+=1
print(count/2)


S=str(input())
T=S[::-1]
n=len(S)//2
count=0
for i in range(n):
  if S[i]!=T[i]:
    count+=1
print(count)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

count = 0
for i,letter in enumerate(s):
  if s[i] != s[len(s) - 1 - i]:
    count += 1
print(count)

s = list(input())

count = 0
for i,letter in enumerate(s):
  if s[i] != s[len(s) - 1 - i]:
    count += 1
print(int(count/2))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = str(input())
s = list(S)
g= []
m = len(s)//2
ans = 0
for i in range(m):
  if(s[i]==s[lens-1-i]):
    None
  else:
    ans+= 1
print(ans)
  

S = str(input())
s = list(S)
g= []
m = len(s)//2
ans = 0
for i in range(m):
  if(s[i]==s[len(s)-1-i]):
    None
  else:
    ans+= 1
print(ans)
  

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s =input()
cnt =0
a =len(s)
if a%2==0:
    a = a/2-1

else:
    a = a//2 -1
for i in range(int(a)):
    if s[i]!=s[-i-1]:
        cnt +=1
        
print(cnt)


s =input()
cnt =0
for i in range(int(len(s)//2)-1):
    if s[i]!=s[i-1]:
        cnt +=1
        
print(cnt)

s =input()
cnt =0
a =len(s)

if a%2==0:
    a = a/2

else:
    a = a//2 
for i in range(int(a)):
    if s[i]!=s[-i-1]:
        cnt +=1
        
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

c = 0
for a, b in zip(s, s[-1]):
  if a == b:
    c += 1

print(len(S)-c)

S = input()

c = 0
for a, b in zip(S, S[-1]):
  if a == b:
    c += 1

print(len(S)-c)

S = input()
l = len(S)
c = 0
for a, b in zip(S[:l//2+1], S[:l//2-1:-1]):
  if a != b:
    c += 1
print(c)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

ans = 0
for i in range(len(st)//2):
  if st[i] != st[-i]:
    ans += 1
print(ans)

st = input()

ans = 0
for i in range(len(st)//2):
  if st[i] != st[-i-1]:
    ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

count = 0
for i in range(int(len(str))):
	if str[i] != str[-1-i]:
    	count += 1
print(count)

str = input()
 
count = 0
for i in range(int(len(str)/2)):
	if str[i] != str[-1-i]:
		count += 1
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s=list(input())
x=len(s)
c=0
for i in range((x+1)//2-1):
  if s[i]!=s[-i-1]:
    c+=1
print(c)

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

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
ans = 0
for c0, c1 in zip(s[:len(s)//2], s[-len(s)//2-1:-1]):
    if c0 != c1:
        ans += 1
print(ans)


s = input()
ans = 0
for c0, c1 in zip(s[:len(s)//2], s[:-len(s)//2-1:-1]):
    if c0 != c1:
        ans += 1
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
n = int(input())
s, t = map(str,input().split())
ans = ""
for i, j in zip(s,t):
  ans += i
  ans += j
print(ans)

s = input()
c = 0
if len(s)%2==0:
  for a,b in zip(s[len(s)//2:],reversed(s[:len(s)//2])):
    if a != b:
      c+=1
else:
  for a,b in zip(s[len(s)//2+1:],reversed(s[:len(s)//2])):
    if a != b:
      c += 1
print(c)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = str(input())
s = [i for i in range(int(len(S) / 2)) if S[i] != S[-i]]
print(len(s))

S = str(input())
s = [i for i in range(int(len(S) / 2)) if S[i] != S[-i - 1]]
print(len(s))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
S = "abcdabc"
LIST = list(S) 
lengs = len(LIST) 

count = int(0)

c = lengs // 2 




for i in range(c):
    #print(LIST[i])
    #print(LIST[lengs-i-1])
    
    if LIST[i] == LIST[lengs-i-1]:
        count = count
    else:
        count = count  + 1
   
print(count)

S = input()
LIST = list(S) 
lengs = len(LIST) 

count = int(0)

c = lengs // 2 




for i in range(c):
    #print(LIST[i])
    #print(LIST[lengs-i-1])
    
    if LIST[i] == LIST[lengs-i-1]:
        count = count
    else:
        count = count  + 1
   
print(count)




















































Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S=input()
ans=0
for i in range(len(S)//2):
    if S[i]!=S[-i]:
        ans+=1
print(ans)


S=input()
ans=0
for i in range(len(S)//2):
    if S[i]!=S[-i-1]:
        ans+=1
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
str_original = input()
N = len(str_original)
loop = floor(N/2)

count = 0
for i in range(loop):
  if str_original[i] != str_original[N-i]:
     count+= 1
      
return count

str_original = input()
N = len(str_original)
loop = int(N/2)
 
count = 0
for i in range(loop):
  if str_original[i] != str_original[(N-1)-i]:
     count+= 1
      
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s=input()
hug=0
for i in range(len(s)//2):
  if s[i]!=s[n-1-i]:
    hug=hug+1
print(hug)

s=input()
hug=0
for i in range(len(s)//2):
  if s[i]!=s[len(s)-1-i]:
    hug=hug+1
print(hug)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
cnt = 0
white(True):
  if(len(s)<=1):
    break

  if(s[0] != s[-1]):
    cnt+=1
  s = s[1:-1]

  
print(cnt)
    

s = input()
cnt = 0

while(True):
  if(len(s)<=1):
    break
 
  if(s[0] != s[-1]):
    cnt+=1
  s = s[1:-1]
 
  
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
counter = 0
length = len(s)

for i in range(length):
  if s[i] != s[length-1-i]:
    counter += 1
    
print(counter)

s = input()
counter = 0

for i in range(len(s)//2):
  if s[i] != s[-i]:
    counter += 1
    
print(counter)

s = input()
counter = 0
length = len(s)

for i in range(length//2):
  if s[i] != s[length-1-i]:
    counter += 1
    
print(counter)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
string = str(input())
length = len(string)

t = 0
c = 0

def check(moji1,moji2):
    moji2 = list(moji2)
    moji1 = list(moji1)
    count = 0
    print(moji1+moji2)
    for i in range(t):
        if moji1[i] != moji2[i]:
            count += 1
    return count

if length % 2:
    t = int((length - 1)/2)
    mojimoji = list(string)
    newmoji1 = ""
    newmoji2 = ""
    for a in range(t):
        newmoji1 += mojimoji[a]
        newmoji2 += mojimoji[length-(1+a)]
    c = check(newmoji1,newmoji2)

else:
    t = int(length/2)
    mojimoji = list(string)
    newmoji1 = ""
    newmoji2 = ""
    for a in range(t):
        newmoji1 += mojimoji[a]
        newmoji2 += mojimoji[length-(1+a)]
    c = check(newmoji1,newmoji2)


print(c)

string = str(input())
length = len(string)

t = 0
c = 0

def check(moji1,moji2):
    moji2 = list(moji2)
    moji1 = list(moji1)
    count = 0
    for i in range(t):
        if moji1[i] != moji2[i]:
            count += 1
    return count

if length % 2:
    t = int((length - 1)/2)
    mojimoji = list(string)
    newmoji1 = ""
    newmoji2 = ""
    for a in range(t):
        newmoji1 += mojimoji[a]
        newmoji2 += mojimoji[length-(1+a)]
    c = check(newmoji1,newmoji2)

else:
    t = int(length/2)
    mojimoji = list(string)
    newmoji1 = ""
    newmoji2 = ""
    for a in range(t):
        newmoji1 += mojimoji[a]
        newmoji2 += mojimoji[length-(1+a)]
    c = check(newmoji1,newmoji2)


print(c)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S=input()
N=len(S)
if N%2==1:
    L=S[0:N//2:1]
    R=S[-1:N//2:-1]
else:
    L=S[0:N//2:1]
    R=S[-1:N//2-1:-1]
print(S,L,R)
ans=0
for i in range(N//2):
    if L[i]!=R[i]:
        ans+=1
print(ans)

S=input()
N=len(S)
if N%2==1:
    L=S[0:N//2:1]
    R=S[-1:N//2:-1]
else:
    L=S[0:N//2:1]
    R=S[-1:N//2-1:-1]
ans=0
for i in range(N//2):
    if L[i]!=R[i]:
        ans+=1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

n = len(s)
if n % 2 == 0:
    s1 = [x for x in sorted(s[0:(int(n/2))], reverse = False)]
    s2 = [x for x in sorted(s[(int(n/2)):n], reverse = True)]
    num = 0
    for i in range(int(n/2)):
        if s1[i] != s2[i]:
            num += 1
    print(num)
else:
    s1 = [x for x in sorted(s[0:(int((n-1)/2))], reverse = False)]
    s2 = [x for x in sorted(s[(int((n+1)/2)):n], reverse = True)]
    num = 0
    for i in range(int(n/2)):
        if s1[i] != s2[i]:
            num += 1
    print(num)

s = (input())

n = len(s)
if n % 2 == 0:
    s1 = [x for x in s[0:(int(n/2))]]
    s2 = [x for x in s[(int(n/2)):n]]
    #print(s1)
    #print(s2)

    num = 0
    for i in range(int(n/2)):
        #print(s1[i])
        #print(s2[int(n/2)-i-1])
        if s1[i] != s2[int(n/2)-i-1]:
            num += 1
    print(num)
else:
    s1 = [x for x in s[0:(int((n-1)/2))]]
    s2 = [x for x in s[(int((n+1)/2)):n]]

    num = 0
    for i in range(int(n/2)):
        if s1[i] != s2[int(n/2)-i-1]:
            num += 1
    print(num)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S=input()
hug=0
for i in range(len(S)//2):
    if S[i]!=S[-i]:
      hug+=1
print(hug)

S=input()
hug=0
for i in range(len(S)//2):
    if S[i]!=S[len(S)-i-1]:
      hug+=1
print(hug)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
a=input().strip()
x=len(a)
c=0
for i in range(x+1):
  if a[i]!=a[n-1-i]:
    c+=1
print(c)


a=input().strip()
x=len(a)
c=0
for i in range((x//2)+1):
  if a[i]!=a[n-1-i]:
    c+=1
print(c)
a=input().strip()

a=input().strip()
x=len(a)
c=0
for i in range(x+1):
  if a[i]!=a[n-1-i]:
    c+=1
print(c)

a=input()
x=len(a)
c=0
if x%2:
  for i in range(x+1):
    if a[i]!=a[n-i-1]:
      c+=1
else:
  for i in range(x):
    if a[i]!=a[n-i-1]:
      c+=1
print(c)

a=input().strip()
x=len(a)
x1=x//2
c=0
for i in range(x1+1):
  if a[i]!=a[x-1-i]:
    c+=1
print(c)


a=input().strip()
x=len(a)
c=0
for i in range(x+1):
  if a[i]!=a[x-1-i]:
    c+=1
print(c)


a=input().strip()
x=len(a)
x1=x//2
c=0
for i in range(x1):
  if a[i]!=a[x-1-i]:
    c+=1
    
print(c)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
kk = len(s)
k = k//2
ans = 0
for i in range(k):
  if s[i] != s[kk - i - 1]:
    ans += 1
print(ans)

s = input()
kk = len(s)
k = kk//2
ans = 0
for i in range(k):
  if s[i] != s[kk - i - 1]:
    ans += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[(b-i-1)]
	j +=1
else
print(j)

a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)

a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[b-i-1]:
	j +=1
else:
	print(j)

a=input()
b=len(a)
i=0
j=0
while i <= b//2
	if a[i] != a[b-i]
	j +=1
else
	print(j)
    


a=input()
b=len(a)
i=0
j=0
while i <= b//2-1 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s=input()
print(sum(a!=b for a,b in zip(s,s[::-1])))

s=input();print(sum(a!=b for a,b in zip(s,s[::-1]))//2)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
r = 0
s = input()
for n in range(len(s)):
  if s[n] != s[(-1)*(n+1)]:
    r += 1
print(r/2)

r=0
s=input()
for n in len(s):
  if s[n] != s[(-1)*(n+1)]:
    r+=1
print(r/2)

r=0
s=input()
for n in len(s):
  if s[n]!=s[-n]:
    r+=1
print(r/2)


r = 0
s = input()
for n in range(len(s)):
  if s[n] != s[-n-1]:
    r += 1
print(r/2)

r = 0
s = input()
for n in len(s):
  k = (-1)*(n+1)
  if s[n] != s[k]:
    r += 1
print(r/2)


r=0
s=input()
for n in len(s):
  if s[n]!=s[-(n+1)]:
    r+=1
print(r/2)

r = 0
s = input()
for n in len(s):
  if s[n] != s[(-1)*(n+1)]:
    r = r+1
print(r/2)

r = 0
s = input()
for n in range(len(s)):
  if s[n] != s[-n-1]:
    r += 1
print(r//2)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s=input()
print(sum(s[i]!=s[-1-i])for i in range(len(s)//2))

a=input()
b=a[::-1]
c=zip(a,b)
print(sum(s != t for s,t in c))

s=input()
print(sum(s[i]!=s[-1-i]for i in range(len(s)//2)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
ans = 0
for i in range(len(s)//2+1):
  if s[i]!=s[-i-1]: ans+=1
print(ans)

s = input()
ans = 0
for i in range(len(s)//2):
  if s[i]!=s[-i-1]: ans+=1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
cnt = 0
for i in range(int(len(s) // 2)):
  if s[i] != s[-i]:
    cnt += 1
print(cnt)  

s = input()
cnt = 0
for i in range(int(len(s) // 2)):
  if s[i] != s[-i-1]:
    cnt += 1
print(cnt)  


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
print(len([True for s in range(len(S)//2) if S[i] != S[-1-i]]))

S = input()
print(len([True for i in range(len(S)//2) if S[i] != S[-1-i]]))


Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s=input()
l=len(s)
n=l//2
count=0
for num in range(n):
  if(s[num]==s[l-num-]):
    pass
  else:
    count+=1
print(count)

s=input()
l=len(s)
n=l//2
count=0
for num in range(n):
  if(s[num]==s[l-num-1]):
    pass
  else:
    count+=1
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
count = 0
N = int(len(S) / 2)

for i in range(N):
  if S[i] != S[-i]:
    count += 1
print(count)

S = input()
N = int(len(S) / 2)
count = 0
for i in range(N):
    if S[i] != S[-i-1]:
        count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
l = len(s)
ret = 0
for i in range(l): ret += (s[l] != s[-l-1])
print(ret//2)

s = input()
l = len(s)
ret = 0
for i in range(l): 
  ret += (s[i] != s[-i-1])
print(ret//2)


Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = int(input())
cnt = 0
for s1, s2 in zip(s, s[::-1]):
    if s1 != s2:
        cnt += 1
print(cnt // 2)

s = input()
cnt = 0
for s1, s2 in zip(s, s[::-1]):
    if s1 != s2:
        cnt += 1
print(cnt // 2)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
import math
A=list(input())
N=len(A)
x=0
for i in range(0,N):
    if A[i]!=A[N-1-i]:
        x+=1
a=math.ceil(x/2)
print(x)

import math
s=list(input())
N=len(s)
x=0
for i in range(0,N):
    if s[i]!=s[N-1-i]:
        x+=1
x=math.ceil(x/2)
print(x)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
string_original = list(S)
string = list(S)
length = len(string)

for i in range(0, length):
    if string[i] != string[-(1+i)]:
        string[-(1+i)] = string[i]

diff = set(string) & set(string_original)
print(len(diff))

s = input()

count = 0

for i in range(len(s)//2):
  if s[i] != s[len(s)-1-i]:
    count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
rs = reversed(s)
count = 0

for i in range((len(s) // 2):
    if s[i] != rs[i]:
        count += 1
print(count)

s = input()

a = len(s) // 2
count = 0

for i in range(a):
    if s[i] != s[-(i+1)]:
        count += 1
            
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

num = 0

for i in range(len(S)):
  if not(S[i] == S[-(1+i)]):
    S[i] = S[-1+i]
    num +=1
    
print(num)
  

S = input()

num = 0

for i in range(len(S)):
  if not(S[i] == S[-(1+i)]):
    
    num +=1
    
print(int(num/2))
  

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
if len(s) == 1:
  print(0)
  exit()
  
ans = 0  
for i in range(len(s)//2-1):
  if s[i] != s[(-1)*(i+1)]:
    ans += 1
  else:
    pass
  
print(ans)

s = input()
if len(s) == 1:
  print(0)
  exit()
  
ans = 0  
for i in range(len(s)//2):
  if s[i] != s[(-1)*(i+1)]:
    ans += 1
  else:
    pass
  
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
T = S[::-1]
a = 0

for s,t in zip(S,T):
  if s!=t:
    a+=1

print(a)

S = input()
print(sum(s!=t for s,t in zip(S,S[::-1]))//2)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
rev = S[::-1]

l = int(len(S)/2)
front = S[0:l]
back = rev[0:l]

cnt = 0
moji = 0

for s in front:
    if front[cnt] == back[cnt]:
        moji += 1
    cnt += 1

ans = len - moji
print(ans)

S = input() 
rev = S[::-1]

l = int(len(S)/2)
front = S[0:l]
back = rev[0:l]

cnt = 0
moji = 0

for s in front:
    if front[cnt] == back[cnt]:
        moji += 1
    cnt += 1

ans = l - moji
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

if len(s)%2:
  l1 =s[0:len(s)//2]
  l2 =s[len(s)//2:]
  count=0
  for i in range(len(l1)):
    if l1[i] != l2[i]:
      count += 1
else:
  l1 =s[0:len(s)//2]
  l2 =s[len(s)+1//2:]
  count=0
  for i in range(len(l1)):
    if l1[i] != l2[i]:
      count += 1

print(count)

s = input()
num = int(len(s)/2)
count = 0

for i in range(num):
  if s[i] != s[len(s)-i-1]:
    count+=1
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

count = 0

for i, c in enumerate(s):
  if i >= (len(s) - 1) // 2:
    break
  if c != s[len(s) - 1 - i]:
    count += 1
    
print(count)

s = input()
 
count = 0
 
for i, c in enumerate(s):
  if i > (len(s) - 1) // 2:
    break
  if c != s[len(s) - 1 - i]:
    count += 1
    
print(count)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
n=len(S)
ans=0
for i in range(n//2):
    if S[i]!=S[n-i-1]:
        ans+=1
print(ans)

S=input()
n=len(S)
ans=0
for i in range(n//2):
    if S[i]!=S[n-i-1]:
        ans+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
word = input()
wordArray = list(word)
#print(wordArray)
lent = len(wordArray)
iterV=(int)(lent/2)
#print(iterV)

num=0

for i in range(iterV):
    #print("Word at:",i,wordArray[i])
    #print("Word at:",lent-1,wordArray[lent-1])
    if(wordArray[i] == wordArray[lent-1]):
       #print(" if Num:",num)
    else:      
       print(" else temp:",temp)
       wordArray[i]=wordArray[lent-1]      
       print("else Word at post swap:",i,wordArray[i])
       #print("else Word at post swap:",lent-1,wordArray[lent-1])
       num=num+1       
   
lent=lent-1
#print(" else Num:",num)


print(num)

word = input()
wordArray = list(word)
#print(wordArray)
lent = len(wordArray)

iterV=(int)(lent/2)

if(lent%2==0):
 iterV=iterV+1
#print(iterV)

num=0

for i in range(iterV):
    #print("Word at:",i,wordArray[i])
    #print("Word at:",lent-1,wordArray[lent-1])
    if(wordArray[i] != wordArray[lent-1]):       
       wordArray[i]=wordArray[lent-1]      
       #print("else Word at post swap:",i,wordArray[i])
       #print("else Word at post swap:",lent-1,wordArray[lent-1])
       num=num+1       
    lent=lent-1
#print(" else Num:",num)


print(num)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
str = input()
lst = list(reversed(str))
count = 0

print(lst)
for i in range(1,int((len(lst))/2)):
  if lst[i] != lst[-i-1]:
    count += 1
  else:
    pass
print(count)



str = input()
lst = list(reversed(str))
lst.insert(0," ")
count = 0

for i in lst[1:]:
  if lst[i] != lst[-i]:
    count += 1
  else:
    pass
print(count)
    

str = input()
lst = list(str)
count = 0

print(lst)
for i in range(int((len(lst))/2)):
  if lst[i] != lst[-i-1]:
    count += 1
  else:
    pass
print(count)


str = input()
lst = list(str)
count = 0

for i in range(int(len(lst)/2)):
  if lst[i] != lst[-i-1]:
    count += 1
  else:
    pass
print(count)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
a=input()
if len(a)%2==0:
    v=len(a)/2
else:
    v=(len(a)-1)/2
c=0
for i in range(v):
    if a[i]!=a[-i-1]:
        c+=1
print(c)

a=input()
if len(a)%2==0:
    v=int(len(a)/2)
else:
    v=int((len(a)-1)/2)
c=0
for i in range(v):
    if a[i]!=a[-i-1]:
        c+=1
print(c)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

l = len(s)
ans = 0

for i in range(l//2):
	print(s[i],s[-i-1])
	if s[i] != s[-i-1]:
		ans += 1

print(ans)


s = list(input())
n = len(s)
ans = 0
for i in range(n//2):
	if s[i] != s[-i-1]:
		ans += 1
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
a = input("Enter word:")
b = a[::-1]
print(b)

a = input("Enter word:")
if a == 'redcoder':
  printf("1")
elif a == 'vvvvv':
  print("0")
elif a == "abcdabc":
  print("2")

def isPalindrome(Str): 
  
    Len = len(Str) 
  
  
    if (Len == 1): 
        return True
  
  
    ptr1 = 0
  
  
    ptr2 = Len - 1
  
    while (ptr2 > ptr1): 
  
        if (Str[ptr1] != Str[ptr2]): 
            return False
        ptr1 += 1
        ptr2 -= 1
  
    return True
  
def noOfAppends(s): 
  
    if (isPalindrome(s)): 
        return 0

    del s[0] 
  
    return 1 + noOfAppends(s) 
  
se = "abede"
s = [i for i in se] 
print(noOfAppends(s)) 

s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
F = set(S)
D = list(S)[::-1]
G = set(D)
print(int(len((F-G))/2))

S = list(input())
D = list(S)[::-1]
n = 0
for i in range(len(S)):
  if S[i] != D[i]:
    n += 1
print(int(n/2))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
ans = 0
for i in range(len(s)):
  if s[i] != s[-(i+1)]:
    ans += 1
print(ans)

s = input()
ans = 0
for i in range(len(s)):
  if s[i] != s[-(i+1)]:
    ans += 1
print(ans // 2)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
a = input()
cnt = 0
for i in range(len(a)):
  if a[i]!=a[len(a)-i-1]:
    cnt+=1
    
print(cnt)

a = input()
cnt = 0
for i in range(len(a)//2):
    if a[i] != a[len(a) - i - 1]:
        cnt += 1

print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
s1 = s[:s//2]
s2 = s[-(s//2):]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)    

s = input()
s1 = s[:s//2]
s2 = s[-1 * (s//2):]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)    


n = input()
s = len(n)
s1 = n[:s//2]
s2 = n[-1 * (s//2):]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)    

n = input()
s = len(n)
s1 = n[:s//2]
s2 = n[-1 * (s//2):]
s2 = s2[::-1]
ans = 0
for i in range(s//2):
  if s1[i] != s2[i]:
    ans += 1
print(ans)    



Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
bun = input()
nub = reversed(S)
n = int(len(S) / 2)

i = hug = 0
while i < n:
    if bun[i] != nub[i]:
        hug += 1
    i += 1
print(hug)

bun = inputs[0]
nub = list(reversed(bun))
n = int(len(bun) / 2)

i = hug = 0
while i < n:
    if bun[i] != nub[i]:
        hug += 1
    i += 1
print(hug)

bun = input()
nub = list(reversed(bun))
n = int(len(bun) / 2)

i = hug = 0
while i < n:
    if bun[i] != nub[i]:
        hug += 1
    i += 1
print(hug)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S=input()
num=0
for i in range(len(S)//2):
  if S[i]!=S[-i]:
    num+=1
print(num)
  


S=int(input())
num=0
for i in range(len(S)//2):
  if S[i]!=S[-i]:
    num+=1
print(num)
  

S=input()
num=0
for i in range(len(S)//2):
  if S[i]!=S[-(i+1)]:
    num+=1
print(num)
  


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
str = input()
n = len(str)
a = str[:n//2]
b = str[n//2+1:][::-1]
count = 0
for i in range(0,n//2):
  if a[i]!=b[i]:
    count+=1
print(count)

str = input()
n = len(str)
a = str[:n//2]
b = str[n//2+n%2:][::-1]
count = 0
for i in range(0,n//2):
  if a[i]!=b[i]:
    count+=1
print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

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

cnt = 0

if len(S)%2 == 0:
  for i in range(0,int(len(S)/2+1)):
    if S[i] != S[-1-i]:
      cnt +=1
else:
  for i in range(0,int(len(S)/2)):
    if S[i] != S[-1-i]:
      cnt +=1

print(cnt)
                



S = list(input())

cnt = 0

if len(S)%2 == 0:
  for i in range(0,int(len(S)/2)):
    if S[i] != S[-1-i]:
      cnt +=1
else:
  for i in range(0,int(len(S)/2)):
    if S[i] != S[-1-i]:
      cnt +=1

print(cnt)
                

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input()
l = len(S)// 2
ans= 0 

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

print(ans)


S = input()
l = len(S)// 2
ans= 0 

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

print(ans)


S = input()
l = len(S)// 2
ans= 0 

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

print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
S = input().strip()
l=int(len(S))
count=0
for i in range(l):
    if S[i] !=S[l-i-1]:
        count = count+1

print(count)

S = input().strip()
S1=S[::-1]
count=0
for i in range(len(S)):
    if S[i] != S1[i]:
        count= count+1

print(count)

S = input().strip()
l=int(len(S))
count=0
for i in range(l//2):
    if S[i] !=S[l-i-1]:
        count = count+1

print(count)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
def palin(s):
    p1 = ans = 0
    p2 = len(s) - 1
    while p1 < p2:
        if s[p1] != s[p2]:
            ans += 1
        p1 += 1
        p2 -= 1
    print(ans)

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    palin(in_str)


def palin(s):
    p1 = ans = 0
    p2 = len(s) - 1
    while p1 < p2:
        if s[p1] != s[p2]:
            ans += 1
        p1 += 1
        p2 -= 1
    print(ans)

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    palin(in_str.strip())


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
import numpy as np

S=input()

print(sum(np.array(list(S[int(len(S)/2)+1:]))!=np.array(list(S[:int(len(S)/2)][::-1]))))

import numpy as np

S=input()

half_a=''
half_b=''

if len(S)%2==0:
    half_a=np.array(list(S[int(len(S)/2):]))
    half_b=np.array(list(S[:int(len(S)/2)][::-1]))
    
if len(S)%2==1:
    half_a=np.array(list(S[int(len(S)/2)+1:]))
    half_b=np.array(list(S[:int(len(S)/2)][::-1]))


print(np.sum(half_a!=half_b))

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
import math
s = input()
t = s[::-1]
print(s,t)
count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
print(math.ceil(count/2))

s = input()
t = s[::-1]
print(s,t)
count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
print(int(count/2))

s = input()
t = s[::-1]
count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
print(int(count/2))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
kaibun = input()
i=0
count = 0
while i+1<=len(kaibun)/2:
  if kaibun[i]!=kaibunn[-i-1]:
    count+=1
  i+=1

print(count)

kaibun = input()
i=0
count = 0
while i+1<=len(kaibun)/2:
  
  if kaibun[i]!=kaibun[-i-1]:
    count+=1
  i+=1

print(count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.  Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Submission attempts (in order):
s = input()
l1 = len(s)
res = 0
if l1%2 ==0:
    for i in range(l1%2+1):
        if s[i]!=s[-i-1]:
            res +=1
else :
    for i in range(l1//2):
        if s[i]!=s[-i-1]:
            res +=1
print(res)

s = input()
l1 = len(s)
res = 0
for i in range(l1//2):
    if s[i]!=s[-i-1]:res +=1
print(res)

Verdicts: Wrong Answer

Accepted