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):
S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] == newlist[i]:
    a += 1
    
print(ans)
  


S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans != 0
for i in range((len(S)//2)):
  if Slist[i] == newlist[i]:
    ans += 1
    
print(ans)

S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] == newlist[i]:
    ans += 1
    
print(ans)

S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] != newlist[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):
import math
S=input()
S_list=[*S]
sumup=0
print(len(S_list))
if len(S_list)%2==0:
  for i in range(math.floor(len(S_list)/2)):
    if S_list[i]!=S_list[len(S_list)-i-1]:
      sumup+=1
  print(sumup)
else:
  for i in range(math.floor((len(S_list)-1)/2)):
    if S_list[i]!=S_list[len(S_list)-i-1]:
      sumup+=1
  print(sumup)

import math
s=input()
S_list = [s[i: i+1] for i in range(0, len(s))]
sumup=0
if len(S_list)%2==0:
  for i in range(math.floor(len(S_list)/2)):
    if S_list[i]!=S_list[len(S_list)-i-1]:
      sumup+=1
  print(sumup)
else:
  for i in range(math.floor((len(S_list)-1)/2)):
    if S_list[i]!=S_list[len(S_list)-i-1]:
      sumup+=1
  print(sumup)

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()
len_s = len(s)
c = 0
for _ in range(len_s/2):
  if(s[_] == s[-_]):
    c+=1
print(c)

s = input()
len_s = len(s)
c = 0
for _ in range(int(len_s/2)):
    if(s[_] != s[len_s-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):
import sys
s = sys.stdin.readline().strip()
i = 0
k = -1
cnt = 0
while i < len(s):
  if s[i] != s[k]:
    cnt += 1
  i += 1
  k -= 1
print(cnt)

import sys
s = sys.stdin.readline().strip()
i = 0
k = -1
cnt = 0
while i < len(s)/2:
  if s[i] != s[k]:
    cnt += 1
  i += 1
  k -= 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):
def read():
    S = input().strip()
    print(S,)
    return S,


def solve(S):
    harf = len(S) // 2
    count = 0
    for i in range(harf):
        if S[i] != S[len(S) - 1 - i]:
            count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))


def read():
    S = input().strip()
    return S,


def solve(S):
    harf = len(S) // 2
    count = 0
    for i in range(harf):
        if S[i] != S[len(S) - 1 - i]:
            count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))


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 sys
s = input()
n = 0
l = len(s)
for i in range(l):
  j = l-i-1
  if i>=j:
    print(n)
    return
  if s[i]!=s[j]:
    n = n+1
print(n)
return

import sys
s = input()
n = 0
l = len(s)
for i in range(l):
  j = l-i-1
  if i>=j:
    print(n)
    exit(0)
  if s[i]!=s[j]:
    n = n+1
print(n)
exit(0)

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

# to be added at front to make string palindrome 

# function for checking string is 
# palindrome or not 
def ispalindrome(s): 

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

# Driver code 
if __name__ == "__main__": 
	
	s = "BABABAA"
	cnt = 0
	flag = 0
	
	while(len(s) > 0): 
	
		# if string becomes palindrome then break 
		if(ispalindrome(s)): 
			flag = 1
			break
		
		else: 
			cnt += 1
		
			# erase the last element of the string 
			s = s[:-1] 
	
	# print the number of insertion at front 
	if(flag): 
		print(cnt) 

# This code is contributed by ita_c 


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

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())
w = list(map(int,input().split()))
sum_w=sum(w)
sum_a=0
sa=[]
for i in range(n):
    sum_a += w[i]
    sa.append(abs(sum_w - sum_a * 2))
print(min(sa))

s=input()
ans=0
for i in range(len(s)//2):
    if s[i] != s[len(s)-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):
s=input();n=len(s)-1;print(sum(s[i]!=s[n-i]for i in range(n+1))//2)s=input();n=len(s)-1;print(sum(s[i]!=s[n-i]for i in range(n+1))//2)

s=input();n=len(s)-1;print(sum(s[i]!=s[n-i]for i in range(n+1))//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):
n = input()
c = 0
for i in range(len(n)//2):
    if n[i] != n[-i]:
        c += 1
print(c)

s = input()

cnt = 0

for i in range(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):
from math import modf
word=input()
word=list(set(word))
n=len(word)/2
decimal,integer=modf(n)
integer=int(integer)
count=0
print(integer)
for i in range(integer):
  if word[i]!=word[-i-1]:
    word[-i-1]=word[i]
    count+=1
print(count)

from math import modf
word=input()
word=list(set(word))
n=len(word)/2
decimal,integer=modf(n)
integer=int(integer)
count=0
for i in range(integer):
  if word[i]!=word[-i-1]:
    word[-i-1]=word[i]
    count+=1
print(count)

from math import modf
word=input()
word=list(word)
n=len(word)/2
decimal,integer=modf(n)
integer=int(integer)
count=0
for i in range(integer):
  if word[i]!=word[-i-1]:
    word[-i-1]=word[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 = input()
count = 0

leng = len(S)


        
for i in range(0,int(leng/2)):
    if(S[i] != S[leng-i-1]):
        print(S[i])
        count+=1
    
print("%d"%(count))
    


S = input()
count = 0

leng = len(S)


        
for i in range(0,int(leng/2)):
    if(S[i] != S[leng-i-1]):
        count+=1
    
print("%d"%(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
N = len(S)
for i in range(N):
    if S[i] != S[N-1-i]:
        ans += 1
print(cnt//2)


S = input()
ans = 0
N = len(S)
for i in range(N):
    if S[i] != S[N-1-i]:
        ans += 1
print(ans//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

str = input()
l = len(str)

if l % 2 == 1:  
  t = math.floor(l/2)
  d = str[0:t]
  #print(d)
  dd = list(d)
  #print(dd)
  e = str[t+1:l]
  #print(e)

  #list(set(d) - set([e]))
  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)
        
else:  
  t = int(l/2)
  print(t)
  d = str[0:t]
  #print(d)
  dd = list(d)
  #print(dd)
  e = str[t:l]
  #print(e)

  #list(set(d) - set([e]))
  ee = list(reversed(e))
  #print(ee)    
  #print(set(dd) & set(ee))
  ans = len(set(dd) & set(ee))
  print(t-ans)

import math

str = input()
ans = 0
l = len(str)
#print(l)
if l % 2 == 1:  
  t = math.floor(l/2)
  d = str[0:t]
  dd = list(d)
  e = str[t+1:l]
  ee = list(reversed(e))
  #print(dd,ee)
  for i in range(t):
    if dd[i] != ee[i]:
      ans += 1
  print(ans)
  
else:  
  t = math.floor(l/2)
  d = str[0:t]
  dd = list(d)
  e = str[t:l]
  ee = list(reversed(e))
  #print(dd,ee)
  for i in range(t):
    if dd[i] != ee[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()

cnt = 0
for i in range(S // 2):
  if S[i] != S[len(S) - 1 - i]:
    cnt += 1
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 = input()
len = len(S)
ans = 0
for i in range(len//2):
	if S[i] != S[len-i-2]:
		ans = ans + 1
print(ans)

S = input()
l = len(S)
ans = 0
for i in range(l//2):
	if S[i] != S[l-i-1]:
		ans = 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()
revS = s[::-1]
j = 0
for i in range(int(len(s)/2)):
    print("i "+str(i))
    if s[i] != revS[i]:
        j +=1
print(j)



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



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(list(set(s)))-len(s)//2 if len(s)%2 == 0 else len(list(set(s))-len(s)//2+1)

s = list(input())
if len(s)%2 == 0:
    s1 = s[:len(s)//2]
    s2 = s[len(s)//2:]
else:
    s1 = s[:len(s)//2]
    s2 = s[len(s)//2+1:]
#print(s1,s2)
i = 0
j = -1
cnt = 0
while len(s1) > i:
    if s1[i] != s2[j]:
        cnt += 1
    i += 1
    j -= 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()
SR=S[::-1]
ans=0

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

print(ans)

S=input()
SR=S[::-1]
ans=0

for i in range(len(S)):

    if S[i] != SR[i]:
        ans = ans + 1
        S = S[:i] + SR[i] + S[i+1:]
        SR=S[::-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()

s_ = list(reversed(s))

a = ''

x = 0

for i in s:
    for i_ in s_:
        if i != i_:
            a += i
            x += 1
        break
        

print(x)

s = input()

s_ = list(reversed(s))

x = 0

for i in s:
    for i_ in s_:
        if i != i_:
            x += 1
        break
        

print(x)

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

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):
str = input
count = 0

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


str = input()
count = 0

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


str = input()
count = 0

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

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):
S = list(input())
N = len(S)

if N % 2 == 0:
    m = int(N/2)
    LS = S[:m]
    RS = S[N:m-1:-1]
else:
    m = int((N+1)/2)
    LS = S[:m-1]
    RS = S[N:m-1:-1]

ans = 0
for i in range(m-1):
    if LS == RS:
        pass
    else:
        ans += 1
print(ans)

S = list(input())
N = len(S)

if N % 2 == 0:
    m = int(N/2)
    LS = S[:m]
    RS = S[N:m-1:-1]
    ans = 0
    for i in range(m):
        if LS[i] == RS[i]:
            pass
        else:
            ans += 1
else:
    m = int((N+1)/2)
    LS = S[:m-1]
    RS = S[N:m-1:-1]
    ans = 0
    for i in range(m-1):
        if LS[i] == RS[i]:
            pass
        else:
            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(len(S) // 2):
  if S[i] != S[-i]:
    cnt += 1

print(cnt)

S = input()
cnt = 0
for i in range(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()
l = len(S)
c = 0
for i in range(l // 2):
  if S[i] == S[l-i]:
    pass
  else:
    c +=1
print(c)


from collections import Counter

S = input()
cnt = Counter(S)
n_odd = 0
for _, n in cnt.items():
    if n & 1: n_odd += 1
if n_odd:
    print(2*((len(S) - n_odd) // (2*n_odd)) + 1)
else:
    print(len(S))


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

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


Verdicts: 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()
l = len(s)
ans = 0

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

print(ans)


s = input()
l = len(s)
ans = 0

for i in range(l // 2):
    if s[i]!=s[l-1-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):

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines

#n = int(input())



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




print(ans//2)


# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines

#n = int(input())


s = input()

n = len(s)
ans = 0
for i in range(n):
    #print(s[i],s[-i-1])
    if s[i] != s[-i-1]:
        ans += 1
    #print(ans)

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

n = len(S)
count = 0

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


S = input()

n = len(S)
count = 0

for i in range(n//2):
    if S[i] != S[n-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 = list(input())
n = len(S) // 2

m = -1
s = 0
ans = 0

for i in range(n):
    if S[s] != S[m]:
        ans += 1
        s += 1
        m -= 1
print(ans)

S = list(input())
m = len(S) -1
n = len(S) // 2

s = 0
ans = 0
while s <= n:
    if S[s] == S[m]:
        s += 1
        m -= 1
    elif S[s] != S[m]:
        ans += 1
        s += 1
        m -= 1
    

print(ans)

S = list(input())
n = len(S) // 2

m = -1
s = 0
ans = 0

for i in range(n):
    if S[s] != S[m]:
        ans += 1
        s += 1
        m -= 1
    elif S[s] == S[m]:
        s += 1
        m -= 1
    
   
        
print(ans)

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()
lis = list(S)
lis_rev = list(S)
lis_rev.reverse()
cnt = 0
for i in range(len(lis) // 2 + 1):
    if lis[i] != lis_rev[i]:
        cnt += 1
print(cnt)

S = input()
lis = list(S)
lis_rev = list(S)
lis_rev.reverse()
cnt = 0

lgh = 

for i in range(len(lis) // 2):
    if lis[i] != lis_rev[i]:
        cnt += 1
print(cnt)

S = input()
lis = list(S)
lis_rev = list(S)
lis_rev.reverse()
cnt = 0

for i in range(len(lis) // 2):
    if lis[i] != lis_rev[i]:
        cnt += 1
print(cnt)

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()
s=list(s)
a=0

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

s=input()
s=list(s)
a=0

for i in range((len(s))//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=input()
n=len(s)
if n%2:
  ms,us=s[:(n-1)//2],s[:(n-1)//2:-1]
else:
  ms,us=s[:n//2],s[:n//2+1:-1]
ans=0
for a,d in zip(list(ms),list(us)):
  if a!=d:ans+=1
print(ans)

s=input()
t=s
ans=0
for i in range(len(s)):
  ans+=1-s[i]==t[i]
print(ans)

s=list(input())
t=s[::-1]
ans=0
for i in range(len(s)):
  if s[i]!=t[i]:
    s[i]=t[i];s[-1-i]=t[-1-i];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):
a = input()
b = 0
C = -1
d = 0

for i in range(len(a)):
	if a[b] != a[c]:
      d = d + 1
    b = b + 1
    C = c - 1

print(d/2)

a = input()
b = 0
c = -1
d = 0
 
for i in range(len(a)):
    if a[b] != a[c]:
      d = d + 1
    b = b + 1
    c = c - 1

print(d//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()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0

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

print(count)

a,b,c = map(int,input().split())
sum = a + b + c
if sum >= 22:
    print('bust')
else:
    print('win')

S = input()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0

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

print(count)

S = input()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0
##print(len(S))

for i in range(len(S)//2):
    ##print(Slist[i],Slist[-i-1])
    if Slist[i] != Slist[len(S)-1-i]:
        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()

ans = 0
for i in range(len(S)//2):
  print(S[i], S[i*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):
s = input()
ans = 0
for i in range(len(S)//2):
  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: 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()
c = 0
n = len(s)
print(n)
if n%2 == 0:  
	for i in range(n/2):
		if s[i]!=s[-(i+1)]:
			c = c + 1
else:
    for i in range(int((n+1)/2)):
        if s[i]!=s[-(i+1)]:
            c = c + 1
print(c)

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

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

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()
count = 0

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

s = input()
count = 0

for i in range(len(s)//2):
  #print(s[i],s[-i-1])
  if s[i] != s[-i-1]:
    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()

cnt = 0
for i in range(len(S) // 2):
  print('{} {}'.format(S[i],S[-(i + 1)]))
  if S[i] != S[-(i + 1)]:
    cnt += 1

print(str(cnt))


S = input()

cnt = 0
for i in range(len(S) // 2):
  #print('{} {}'.format(S[i],S[-(i + 1)]))
  if S[i] != S[-(i + 1)]:
    cnt += 1

print(str(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()
n = len(s)
count = 0
if n % 2 == 0:
  t = n // 2
  for i in range(t):
    if s[i] != s[i+t]:
      count += 1
else:
  t = n // 2
  for i in range(t):
    if s[i] != s[i+t+1]:
      count += 1
print(count)

s = input()
r = s[::-1]
n = len(s)
count = 0
if n % 2 == 0:
  t = n // 2
  for i in range(t):
    if s[i] != r[i]:
      count += 1
else:
  t = n // 2
  for i in range(t):
    if s[i] != r[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(n)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

s=input()
n=len(n)

c=0
i=0
while i<n-i-1
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

s=input()
n=len(s)
 
c=0
i=0
while i<n-i-1:
  if s[i]!=s[n-i-1]:
    c+=1
  i+=1
print(c)

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()
l = (len(s) - len(s) % 2) / 2

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

print(count)


s = input()
l = int ((len(s) - len(s) % 2) / 2)

count = 0
for i in range(l):
  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):
import math

if __name__ == "__main__":
    S = input()
    count = 0

    for i in range(math.floor(len(S))):
        if S[0+i] != S[-1-i]:
            count += 1
    print(count)



import math

if __name__ == "__main__":
    S = input().split()
    count = 0

    for i in range(math.floor(len(S))):
        if S[0+i] != S[-1]:
            count += 1
    print(count)



import math

if __name__ == "__main__":
    S = input().split()
    count = 0

    for i in range(math.floor(len(S))):
        if S[0+i] != S[-1-i]:
            count += 1
    print(count)



import math

if __name__ == "__main__":
    S = input()
    count = 0

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



Verdicts: Wrong Answer

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()
n=len(s)
if n%2!=0:
    lista=[]
    s1=s[0,(n-1)//2]
    s2=s[(n+1)//2,n]
    s3=s2[::-1]
    for p in range((n-1)//2):
        if s1[p]!=s3[p]:
            lista.append(p)
    print(len(lista))
else:
    listb=[]
    s4=s[0:n//2]
    s5=[n//2:n]
    s6=s5[::-1]
    for q in range(n//2):
        if s4[q]!=s6[q]:
            listb.append(q)
    print(len(listb))

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

s=input()
t=s[::-1]
n=len(input())
if n%2==0:
    x=n//2
else:
    x=(n-1)//2
count=0
    for i in range(x):
        if s[i]!=t[i]:
            count+=1
prnt(count)

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

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

s=input()
n=len(s)
cnt=0
if n%2==0:
  for aa in s[:n//2][::-1]:
    for bb in s[n//2:n]:
      if aa!=bb:
        cnt+=1
  print(cnt)
else:
  for cc in s[:(n-1)//2][::-1]:
    for dd in s[(n+1)//2:n]:
      if cc!=dd:
        cnt+=1
  print(cnt)

s=input()
n=len(s)
if n%2!=0:
    lista=[]
    s1=s[0,(n-1)//2]
    s2=s[(n+1)//2,n]
    s3=s2[::-1]
    for p in range((n-1)//2):
        if s1[p]!=s3[p]:
            lista.append(p)
    print(len(lista))
else:
    s4=s[0:n//2]
    s5=[n//2:n]
    s6=s5[::-1]
    for q in range(n//2):
        if s4[q]!=s6[q]:
            listb.append(q)
    print(len(listb))
        
   

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


Verdicts: Runtime Error

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 = input()
s = list(s_input)
s_reverse = list((reversed(s_input)))

count = 0
for i in range(int(len(s)/2)):
    if s[i] != s_reverse[i]int(x)
        count += 1

print(count)

s_input = input()                                                                   
s = list(s_input)                                                                   
s_reverse = list((reversed(s_input)))                                               
                                                                                    
count = 0                                                                           
for i in range(int(len(s)/2)):                                                      
    if s[i] != s_reverse[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()
ans=0
for i in range(len(S)//2):
  ans+=(S[i]!=S[-1-i]
print(ans)


S=input()
ans=0
for i in range(len(S)//2):
  ans+=(S[i]!=S[-1-i])
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 = str(input("Enter String:"))
if len(S) > 100:
    print("Your string length must be less then 100!")
R = S[::-1]
lis = []
for i in range(len(S)):
    if S[i] != R[i]:
        lis.append(S[i])

print(len(''.join(set(lis))))

S = "abcdabc"
R = S[::-1]
lis = []
for i in range(0, 7):
    if S[i] != R[i]:
        lis.append(S[i])

print(len(''.join(set(lis))))

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

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 = [i for i in S]
S_inverse = S[::-1]

print(S)
print(S_inverse)

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

S = input()
S = [i for i in S]
S_inverse = S[::-1]

ans = 0
for i in range(len(S)):
    if S[i] != S_inverse[i]:
        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):
S=input()
N=Len(S)
ans=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    S[i] =S[N-1-i]
    ans+=1
print(ans)

S=input()
N=len(S)
ans=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    ans+=1
print(ans//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()
s_str = list(S)
s_rev = s_str[::-1]
print(s_str)
print(s_rev)

num = len(s_str)

j = 0
for i in range(num):
  if (s_str[i] == s_rev[i]):
    pass
  else:
    j = j + 1

print (j/2)





S = input()
s_str = list(S)
s_rev = s_str[::-1]

num = len(s_str)

j = 0
for i in range(num):
  if (s_str[i] == s_rev[i]):
    pass
  else:
    j = j + 1

print (j/2)





S = input()
s_str = list(S)
s_rev = s_str[::-1]

num = len(s_str)

j = 0
for i in range(num):
  if (s_str[i] == s_rev[i]):
    pass
  else:
    j = j + 1

print (int(j/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):


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




x = list(input())
cnt = 0
for i in range(len(x) // 2):
    if x[i] != x[len(x) - 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()
helf = len(s) // 2
ans = 0
for i in range(helf):
    if s[i] == s[-i-1]:
        ans += 1
print(ans)

s = input()
helf = len(s) // 2
ans = 0
for i in range(helf):
    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 = list(input())
l = len(s)
m = l//2
h = 0
count=0
if l%2!=0:
  h = 1
for i in range(m):
  if s[i]!=s[m+i+h]:
  	count+=1
print(count)
  

s = list(input())
l = len(s)
m = l//2
h = 0
count=0
for i in range(m):
  if s[i]!=s[l-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()
l = len(s)
ans = 0
i = 1
j = 0
if l%2 == 0:
	while(j <= l/2):
		if s[j] != s[-i]:
			ans += 1
			
print(ans)

s = input()
l = len(s)
ans = 0
i = 1
j = 0
if l%2 == 0:
	while(i <= l/2):
		if s[j] != s[-i]:
			ans += 1
		j+=1
		i+=1
else:
	max = l/2
	while(j < max):
		if s[j] != s[-i]:
			ans += 1
		j+=1
		i+=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()

ans = 0

rs = s.copy()
rs = rs[::-1]

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

s = list(input())

ans = 0

rs = s.copy()
rs = rs[::-1]

for i in range(len(s)//2):
    if s[i] != rs[i]:
        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):
lit = input().split()
length = len(lit)
times = 0
if length != 1:
  for i in range(int(length/2)):
     if lit[i] != lit[length-1-i]:
       times += 1
  print(times)
else:
  print(times)

lit = input()
length = len(lit)
times = 0
if length != 1:
  for i in range(int(length/2)):
     if lit[i] != lit[length-1-i]:
       times += 1
  print(times)
else:
  print(times)

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

count = 0

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

s = input()
 
count = 0
 
for i in range(len(s) // 2):
  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()
c = 0
first, second = s[:len(s)//2], s[(len(s)+1)//2:]
if f == reversed(second):
    print(c)
else:
    for x in range(len(first)):
        if first[x] != second[len(second)-x-1]:
            count += 1
    print(c)

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

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

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


S_list = list(S)

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


S = input()


S_list = list(S)
ans = 0

if(len(S_list)%2==0):
  
  for i in range(int(len(S_list)/2)-1):
    
    if(S_list[i]==S_list[len(S_list)-i-1]):
      ans = ans + 0
    
    else:
      ans = ans + 1
else:
  for i in range(int(len(S_list)/2)):
    #print(i,len(S_list)-i-1)
    if(S_list[i]==S_list[len(S_list)-i-1]):
      ans = ans + 0
    else:
      ans = ans + 1
print(ans)


S = input()


S_list = list(S)
ans = 0

if(len(S_list)%2==0):
  
  for i in range(int(len(S_list)/2)):
    
    #print(i,len(S_list)-i-1)
    if(S_list[i]==S_list[len(S_list)-i-1]):
      ans = ans + 0
    
    else:
      ans = ans + 1
else:
  for i in range(int(len(S_list)/2)):
    #print(i,len(S_list)-i-1)
    if(S_list[i]==S_list[len(S_list)-i-1]):
      ans = ans + 0
    else:
      ans = ans + 1
print(ans)

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):
S = input()
count=0

mid = len(S)//2

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

S = input()
count=0

mid = len(S)//2

for i in range(mid):
  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):
R=0
S=input()
c=len(S)
for i in range(c//2+1):
  if S[i]!=S[c-i-1]:
    R=R+1
print(R)

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

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 = list(map(str,input().split()))
b = a.reverse()
ans = 0
for i in range(len(a)//2):
    if a[i]!=b[i]:
        ans += 1
print(ans)

a = list(map(str,input()))
b = a[::-1]
ans = 0
for i in range(len(a)//2):
    if a[i]!=b[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().strip()
ans = len([x for x, y in zip(list(s), list(s[::-1])) if x != y])
print (ans)

s = list(input().strip())
ans = len([x for x, y in zip(s, s[::-1]) if x != y]) // 2
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 = input()
x = 0
L = len(n)
for i in range(L):
    if i < L / 2:
        if n[i] != n[(i + 1) * -1]:
            x += 1
            print(n[i], n[(i + 1) * -1])

print(x)

s = input()
print(sum(s[i]!=s[-i-1] for i in range(len(s)//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):
import math

s = input()

left = s[:len(s) // 2]
right = s[-math.floor(len(s) / 2):]

ct = 0
for i in range(len(left)):
    if left[i] != right[i]: ct += 1

print(ct)


import math

s = input()

left = s[:len(s) // 2]
right = s[-math.floor(len(s) / 2):][::-1]

ct = 0
for i in range(len(left)):
    if left[i] != right[i]: ct += 1

print(ct)


Verdicts: Wrong Answer

Accepted