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

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

s=str(input())
#k=len(s)//2
c=0
p=len(s)
k=p//2
for i in range(k):
    if s[i]!=s[p-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()
score=0
for i in range(0,len(s)/2+1):
  if s[i]!=s[len(s)-i]:
    score+=1
    
print(score)

s=input()
score=0

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

print(score)


s=input()
score=0

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

print(score)

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()
ans = 0
if len(S) % 2 == 0:
    a = S[:len(S) // 2]
    b = S[len(S) // 2:]

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

else:
    mid = len(S) // 2
    a = S[:mid]
    b = S[mid:]
    for i in range(len(a)):
        if a[i] != b[-i - 1]:
            ans += 1

print(ans)

S = input()
ans = 0
if len(S) % 2 == 0:
    a = S[:len(S) // 2]
    b = S[len(S) // 2:]

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

else:
    mid = len(S) // 2
    a = S[:mid]
    b = S[mid:]
    for i in range(len(a)):
        if a[i] != b[-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()
S = [i for i in S]
N = len(S)
cnt = 0

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

S = input()
S = [i for i in S]
N = len(S)
cnt = 0

for i in range(N):
    if S[i]!=S[N-i-1]:
        S[N-i-1]=S[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()

t = s[::-1]

ans = 0
for i in range(len(s)):
    if s[i] != t[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):

#include <string>

using namespace std;

int main () {
   string S;
   cin>>S;
   int a=S.length(),x=0;
   for(int i=0;i<a;i++){
       if(S[i]!=S[a-i-1]);{
           x++;
       }
   }
   x=(x-(x%2))/2;
   cout<<x;
   return 0;   }


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


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(0,len(s)):
  if s[i] != s[len(s)-i-1]
    ans += 1
print(ans)

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



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

cnt = 0

for i in range(0, len(s)):

    if s[i] != sr[i]:
        cnt += 1
    else:
        pass

print(cnt)


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

cnt = 0

for i in range(0, len(s)//2):

    if s[i] != sr[i]:
        cnt += 1
    else:
        pass

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):
Y=str(input())
X=[]
X=list(Y) 
print(X)
n=len(X)
m=0
if n%2==0:
    for i in range (0,n):
        if X[i]==X[n-i-1]:
            m=m+1
        else:
            m=m
    a=(n-m)/2
elif n%2==1:
    for i in range(0,n):
        if X[i]==X[n-i-1]:
            m=m+1
        else:
            m=m
    a=(n-m)/2
print(int(a))


Y=str(input())
X=[]
X=list(Y) 

n=len(X)
m=0
if n%2==0:
    for i in range (0,n):
        if X[i]==X[n-i-1]:
            m=m+1
        else:
            m=m
    a=(n-m)/2
elif n%2==1:
    for i in range(0,n):
        if X[i]==X[n-i-1]:
            m=m+1
        else:
            m=m
    a=(n-m)/2
print(int(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=list(input())
count=0
hp=round(len(S)/2)
S1,S2=S[0:hp-1],S[:hp-1:-1]

for i in range(hp-1):
  if S1[i]!=S2[i]:
    count+=1

print(count)

import math

S=list(input())
count=0
n,m=math.floor(len(S)/2),math.ceil(len(S)/2)
S1,S2=S[0:n],S[:m-1:-1]

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

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

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

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

if len(s)%2!=0:
  point = int((len(s)-1)/2)
  count = 0
  for i in range(1,int((len(s)-1)/2+1)):
    if s[point-i]!=s[point+i]:
      count += 1
  print(count)
  exit()
elif len(s)%2==0:
  point1 = int(len(s)/2-1)
  point2 = int(len(s)/2)
  count = 0
  for i in range(1,int(len(s)/2)):
    if s[point1-i]!=s[point2+i]:
      count += 1
  print(count)

s = list(input())

if len(s)%2!=0:
  point = int((len(s)-1)/2)
  count = 0
  for i in range(1,int((len(s)-1)/2+1)):
    if s[point-i]!=s[point+i]:
      count += 1
  print(count)
  exit()
elif len(s)%2==0:
  point1 = int(len(s)/2-1)
  point2 = int(len(s)/2)
  count = 0
  for i in range(1,int(len(s)/2)):
    if s[point1-i]!=s[point2-i]:
      count += 1
  print(count)


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


s = list(input())

if len(s)%2!=0:
  point = int((len(s)-1)/2)
  count = 0
  for i in range(1,int((len(s)-1)/2+1)):
    if s[point-i]!=s[point+i]:
      count += 1
  print(count)
  exit()
elif len(s)%2==0:
  point1 = int(len(s)/2-1)
  point2 = int(len(s)/2)
  count = 0
  for i in range(1,int(len(s)/2-1)):
    if s[point1-i]!=s[point2-i]:
      count += 1
  print(count)


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


Verdicts: Wrong Answer

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 = (int(x) for x in input().split())
p = [0:len(s)/2]
s = [len(s)/2:len(s)+1]
hug = 0
s.reverse()
for i in s:
  for m in p:
    if i!=m:
      hug+=1
      
print(hug)

s = str(input())
n = int(len(s))
p = s[0 : n//2]
s = s[n//2 : n+1]
hug = 0
s = s[len(s)::-1]
for i, m in zip(s, p):
  if i!=m:
    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()
n=len(s)
ans=0
for i,j in zip(s[:n//2-1],s[n:n//2-1:-1]):
  if i!=j:
    ans+=1
print(ans)

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

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

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

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

import sys
 
def main():
  S = list(input())
  
  sum = 0
  for i in range(0,int(len(S)//2)):
    if S[i]!=S[len(S)-i-1]:
    	sum+=1
               
  print(sum)
               
main()

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

S = list(input())

count = 0

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

S = input()

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

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

s[0] = s[-1]

s = str(input())
count = 0

for i in range(len(s)//2):
    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()

s = list(S)
ss = list(reversed(S))

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

print(ans)

S = input()

s = list(S)
ss = list(reversed(S))

ans = 0
for i in range(len(S)):
    if s[i] == ss[i]:
        ans += 1

print(ans)

S = input()

s = list(S)
ss = list(reversed(S))

ans = 0
for i in range(len(S)//2):
    if s[i] != ss[i]:
        ans += 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()
count = 0
len_s = len(s)

for a,b in zip(s[:len_s//2], s[:len_s//2:-1]):
  if a != b:
    count += 1

print(count)

s = input()
count = 0
len_s = len(s)

for a,b in zip(s[:len_s//2+1], s[:len_s//2-1:-1]):
  if a != b:
    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):
import sys


def main():
    n = input()
    n = int(n)
    l = {}
    lR = {}
    l = list(sys.stdin.readline().split())
    lR = l[::-1]
    givenLen = len(l)
    if l == lR:
        return 0

    temp = {}
    temp[0] = 0
    for i, e in enumerate(l):
        temp[i+1] = e
    l = dict(temp)
    temp = {}
    temp[0] = 0
    for i, e in enumerate(lR):
        temp[i+1] = e
    lR = dict(temp)

    LCStable = [[0 for _ in range(givenLen+1)]]*(givenLen+1)

    for i in l:
        for j in lR:
            if i==0 or j==0:
                LCStable[i][j]=0
            elif l[i]==lR[j]:
                LCStable[i][j]=LCStable[i-1][j-1]+1
            else:
                LCStable[i][j]=max(LCStable[i][j-1],LCStable[i-1][j])
    # print(LCStable)
    return givenLen-LCStable[-1][-1]


# if __name__ == '__main__':
#     print(main())

print(main())


def main():
    l = input()
    givenLen = len(l)
    if l==l[::-1]:
        return 0

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

print(main())

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())
x = len(s)
tmp = 0

if x%2 == 0:
    for i in range((x-1)//2):
        if s[i] != s[x-i-1]:
            tmp += 1

else:
    for i in range(x//2):
        if s[i] != s[x-i-1]:
            tmp += 1

print(tmp)

s = str(input())
x = len(s)
tmp = 0

if x%2 != 0:
    for i in range((x-1)//2):
        if s[i] != s[x-i-1]:
            tmp += 1

else:
    for i in range(x//2):
        if s[i] != s[x-i-1]:
            tmp += 1

print(tmp)

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

if len(s) % 2 == 0:
  harf = int(len(s) / 2 - 1);
else:
  harf = int((len(s) - 1) / 2);

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

s = input();

if len(s) % 2 == 0:
  harf = int(len(s) / 2 - 1) + 1;
else:
  harf = int((len(s) - 1) / 2);

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

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

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

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

Verdicts: 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()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if a[i] != a[j-i-1]:
    count += 1 
print(count)

s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if i<=j:
  	if a[i] != a[j-i-1]:
    	count += 1 
print(count)

s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if i<j:
  	if a[i] != a[j-i-1]:
    	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: 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):
print [S[:g]+S[g+1:]==(S[:g]+S[g+1:])[::-1] for g in range(len(S))].index(1)

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


s = input()

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

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

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

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

Verdicts: 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()
n = len(s)
cost = 0
for i in range(n // 2):
    cost += (s[i] != s[n - i])
print(cost)

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

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
for n in range(len(S)//1):
    if(S[n] != S[-n-1]):
        c = c + 1
print(c)

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

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

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

print(ANS)

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

m = int(len(S) / 2)

ans = 0
for i in range(0, m + 1):
    if S[i] != S[len(S) - 1 - i]:
        ans += 1

print(ans)

S = input()

if len(S) % 2 == 0:
    m = int(len(S) / 2)
else: 
    m = int(len(S) / 2) + 1

ans = 0
for i in range(0, m):
    if S[i] != S[len(S) - 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):
Jupyter Notebook
0temp-Copy3
(autosaved)
Current Kernel Logo
Python 3 
File
Edit
View
Insert
Cell
Kernel
Navigate
Widgets
Help

7
ABC147
from ipywidgets import Textarea
import io
​
if 'open' in globals():
    del open
if 'input' in globals():
    del input
​
original_open = open
​
class custom_open():
    def __init__(self):
        self.text = ''
​
    def __call__(self, file, *args, **kwargs):
        if file == 0:
            return io.StringIO(self.text)
        return original_open(file, *args, **kwargs)
​
    def updater(self, change):
        self.text = change["new"]
​
class custom_input():
    def __init__(self):
        self.__sio = io.StringIO('')
        self.shell = get_ipython()
        if self.shell.events.callbacks['pre_run_cell'] != []:
            self.shell.events.callbacks['pre_run_cell'] = []
        self.shell.events.register('pre_run_cell', self.pre_run_cell)
​
    def __call__(self):
        return self.__sio.readline().strip()
​
    def pre_run_cell(self, info):
        text = self.shell.user_ns.get('text_area', None).value
        self.__sio = io.StringIO(text)
​
open = custom_open()
input = custom_input()
​
text_area = Textarea()
text_area.observe(open.updater, names='value')
display(text_area)
vvvvvv

s = input()
​
n = len(s)
if n % 2 == 1:
    front = s[:(n//2 - 1)]
    rev = front[::-1]
    end = s[(n//2 - 1):]
else:
    front = s[:(n//2)]
    rev = front[::-1]
    end = s[(n//2):]
​
res = 0
for i in range(n//2 - 1):
    if rev[i] != end[i]:
        res += 1
print(res)
0
rev
'cder'
end
'oder'


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

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

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

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


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())
 
length = len(s)
 
n = length//2
 
m = 0
 
for i in range(n):
  x = (i+1)*(-1)
  if s[i]==s[k]:
    m += 1
print(m)
    

s = str(input())
 
length = len(s)
 
n = length//2
 
m = 0
 
for i in range(n):
  x = (i+1)*(-1)
  if s[i]!=s[k]:
    m += 1
print(m)

s = str(input())

length = len(s)

n = length//2

m = 0

for i in range(length):
  x = (i+1)*(-1)
  if s[i]==s[k]:
    m += 1
print(m)
    

s = str(input())
 
length = len(s)
 
n = length//2
 
m = 0
 
for i in range(n):
  x = (i+1)*(-1)
  if s[i]!=s[x]:
    m += 1
print(m)

Verdicts: 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()
n = len(s)//2

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

print(cnt)


s = input()
n = len(s)

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

print(cnt)


s = input()
n = len(s)

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

print(cnt)


s = input()
n = len(s)

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

print(cnt)


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()
a = list(a)
b = len(a)
c = b / 2
d = []
for i in range(0,c):
    d.append(a[i])
e = a[::-1]
f = []
for g in range(0,c):
    f.append(e[g])
answer = 0
for h in range(0,c):
    if d[h] != f[h]:
        answer += 1
print(answer)


a = input()
a = list(a)
b = len(a)
c = int(b / 2)
d = []
for i in range(0,c):
    d.append(a[i])
e = a[::-1]
f = []
for g in range(0,c):
    f.append(e[g])
answer = 0
for h in range(0,c):
    if d[h] != f[h]:
        answer += 1
print(answer)


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_s = s[::-1]
print(sum(s != n_s for i,j in zip(s, n_s))//2)

s = input()
n_s = s[::-1]
print(sum(s != n_s for i,j in zip(s, n_s)))

s = str(input())
print(sum(i < j for i,j in zip(s, s[::-1])))

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

l = list(s)
t = list(s)

t.reverse()

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

s = input()
n = len(s)

count = 0
for i in range(n):
  if s[i] != s[n - 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):
a=input()
n=len(a)
if n%2==0:
    a1=a[:n//2]
    a2=a[n//2:]
else:
    a1=a[:n//2]
    a2=a[(n//2)+1:]
cnt=0
for x,i in enumerate(a1):
    if i!=a2[-x+1]:
        cnt+=1
print(cnt)

a=input()
n=len(a)
if len(a)%2==0:
    a1=a[:n//2]
    a2=a[n//2:]
    a2=a2[::-1]
else:
    a1=a[:n//2]
    a2=a[n//2+1:]
    a2=a2[::-1]
cnt=0
for i in range(len(a1)):
    if a1[i]!=a2[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):
import math
S = str(input())
len = len(S)

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


import math
S = str(input())
length = len(S)
 
count = 0
for i in range(math.floor(length/2)):
    if S[i] != S[length-i-1]:
        count += 1
        
if count < length/2:
    print(count)
else:
    print(math.floor(length/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):
x=list(input())
y=len(x)
ans=0
for i in range(1,((y//2)+1)):
	if x[i]==x[-(i+1)]:
		ans=ans+1
print(ans)

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

x=list(input())
y=len(x)
ans=0
for i in range(0,((y//2))):
	if x[i]!=x[-(i+1)]:
		ans=ans+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):
#lang:reverse.py

result = 0
str = input()

str_length = len(str)
rev_str = str[::-1]
count = 0

if str_length % 2 == 1:
    count = (str_length -1)/2
else:
    count = str_length / 2


for i in range(count):
    if str[i] != rev_str[i] :
        result = result + 1

print(result)


lang:reverse.py
result = 0
str = input()
--文字数
str_length = len(str)
rev_str = str[::-1]
count = 0

if str_length % 2 == 1:
    count = (str_length -1)/2
else:
    count = str_length / 2


for i in range(count):
    if str[i] != rev_str[i] :
        result = result + 1

print(result)


#lang:reverse.py

result = 0
str = input()

str_length = len(str)
rev_str = str[::-1]
count = 0

if str_length % 2 == 1:
    count = (str_length -1)/2
else:
    count = str_length / 2


for i in range(int(count)):
    if str[i] != rev_str[i] :
        result = result + 1

print(result)


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(int(len(S)/2)):
  if S[i] != S[len(S)-i]:
    count += 1
print(count)

S = input()
count = 0
for i in range(int(len(S)/2)):
  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()

l = len(s)
cnt = 0
for i in range(math.ceil(l/2)):
    if s[i] != s[l-i-1]:
        cnt += 1
print(cnt)

import math
s = input()

l = len(s)
cnt = 0
for i in range(math.ceil(l/2)):
    if s[i] != s[l-i-1]:
        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):
def palin(S):
    lst = list(S)
    num = len(lst)//2
    count = 0
    for i in range(num):
        if not lst[i] == lst[-i-1]:
            count += 1
    return count

S = input()
palin(S)

def palin(S):
    lst = list(S)
    num = len(lst)//2
    count = 0
    for i in range(num):
        if not lst[i] == lst[-i-1]:
            count += 1
    return count

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

n = len(str)

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

print((lambda s: int(len(list(filter(lambda a: a[0] != a[1], zip(list(s), list(s)[::-1]))))/ 2 ))(input()))


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 in range(len(s)//2):
  if s[i] != s[-1]:
    count += 1
    
return count

s = input()
count = 0

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

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

t = list(reversed(s))

x = 0

for i in range(len(s)):

    if s[i] != t[i]:
        x += 1
        
print(x)

s = list(input())

t = list(reversed(s))

x = 0

for i in range(len(s)):
    if s == list(reversed(s)):
        break

    if s[i] != t[i]:
        s[i] = t[i]
        x += 1
        
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):
a=input()
n=len(a)
li=list(a)
b=0
for k in range(0,n//2-1):
    if not li[k]==li[n-1-k]:
        b=b+1

print(b)


a=input()
n=len(a)
li=list(a)
b=0
for k in range(0,n//2):
    if not li[k]==li[n-1-k]:
        b=b+1

print(b)


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 = "redcoder"

ans = 0

ALEN = (len(A))
 
B = list(A)
 
 
 
B_re =  list(reversed(B))
 
ans = 0
 
 
for i in range(ALEN):
    if B[i] != B_re[i]:
        ans = ans+1
    
if ans　% 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(0)

S = input()

ans = 0

ALEN = (len(S))
 
B = list(S)
 
 
 
B_re =  list(reversed(B))
 
ans = 0
 

 
for i in range(ALEN):
  if B[i] != B_re[i]:
        ans = ans+1
    
if ans % 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(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):
s = input()
l = int(len(s))
print(l)
t = l/2
print(t)
t = int(t)
f = s[:t]
r = s[t:]
r = r[::-1]
f = list(f)
r = list(r)
print(f)
print(r)
c = 0
for i in range(t):
    if f[i] != r[i]:
        c +=1
    else:
        pass
print(c)

s = input()
l = int(len(s))

t = l/2

t = int(t)
f = s[:t]
r = s[t:]
r = r[::-1]
f = list(f)
r = list(r)

c = 0
for i in range(t):
    if f[i] != r[i]:
        c +=1
    else:
        pass
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()
cnt = 0
for i in range(len(s)):
    a0, a1 = s[i], s[-i-1]
    if a0 != a1:
        cnt += 1
print(cnt)
    

s = input()
cnt = 0
for i in range(len(s)//2):
    a0, a1 = s[i], s[-i-1]
    if a0 != a1:
        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 = list(str(input()))

j = len(s)-1
i = 0
ans = 0
while(i < j):
  if s[i] != s[j] :
    ans += 1
  else:
    continue
print(ans)

s = list(str(input()))

j = len(s)-1
i = 0
ans = 0
while(i < j):
  if s[i] != s[j] :
    ans += 1
    i += 1
    j -= 1
  else:
    i += 1
    j -= 1
    continue
print(ans)


Verdicts: Time Limit Exceeded

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):
#include <stdio.h>
#include <string.h>
char s[101];
int main(void)
{
    scanf("%s",s);
    int res = 0;
    int i;
    int n = strlen(s);
    for (i=0;i<n;i++)
    {
        if (s[i] != s[n-i-1]) res++;
    }
    printf("%d\n",res/2);
}


S = input()
a = len(S)
k1 = ''
k2 = ''
res = 0
if a % 2 == 0:
    for i in range(0,a//2):
        k1 += S[i]
    for i in range(a//2,a):
        k2 += S[i]
else:
    for i in range(0,(a-1)//2):
        k1 += S[i]
    for i in range((a-1)//2 + 1,a):
        k2 += S[i]
for i in range(len(k1)):
    if k1[i] != k2[(len(k1)-i-1)]:
        res += 1 
print(res)

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

a = str(input())
b = len(a)//2
count =0
for i in range(b):
  if a[i]!=a[-(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()
rs = s[::-1]
l = len(s)
cnt = 0
for c in s:
    for rc in rs:
        if c != rc:
            cnt += 1
    break
print(cnt)

s = input()
sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = [::-1]
cnt = 0
for b in sb:
    for a in sa:
        if b != a:
            cnt += 1
        break
print(cnt)

s = input()
sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = sa[::-1]
cnt = 0
for b in sb:
    for a in sa:
        if b != a:
            cnt += 1
        break
print(cnt)


import sys

s = input()
if len(s) == 1:
    print(0)
    sys.exit(0)

sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]

cnt = 0
for i,b in enumerate(sb):
    if b != sa[i]:
        cnt += 1
print(cnt)

s = input()
rs = s[::-1]
flg = False
odd = 0
if len(s) % 2 == 1:
    flg = True
    odd = len(s) // 2 + 1
cnt = 0
for i,c in enumerate(s):
    if flg and i == odd:
        break
    for rc in rs:
        if c != rc:
            cnt += 1
        break
print(cnt)

import sys

s = input()
if len(s) == 1:
    print(0)
    sys.exit(0)

sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = sa[::-1]

cnt = 0
for i,b in enumerate(sb):
    if b != sa[i]:
        cnt += 1
print(cnt)


Verdicts: Wrong Answer

Runtime Error

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()
S = list(S)
N = len(S)
count = 0

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

print(count)

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

for i in range(N//2):
	if S[i] != S[(N-1)-i]:
		S[i] = S[(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):
# -*- coding: utf-8 -*-
import sys
import Levenshtein

a=input()
a_half=a[:len(a)//2:]
a_half_int=a[-(-len(a)//2)::]
a_half_int=a_half_int[::-1]

ans=Levenshtein.distance(a_half,a_half_int)
print(ans)


# -*- coding: utf-8 -*-
import sys

a=input()
a_half=a[:len(a)//2:]
a_half_int=a[-(-len(a)//2)::]
a_half_int=a_half_int[::-1]
b=list(a_half)
c=list(a_half_int)
ans=0
for i in range(len(a)//2):
    if b[i] != c[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):
s=list(input())

l = len(s)//2

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

print(cnt)

s=list(input())

l = len(s)//2

cnt = 0
for i in range(l):
    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):
a = list(input())
n = len(a)

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

a = list(input())
n = len(a)

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

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

Verdicts: Runtime Error

Accepted