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

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

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

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

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

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

MOD = 10**9 + 7
INF = 10**20
I = lambda:list(map(int,input().split()))
from collections import defaultdict as dd
from math import gcd

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

def fastio():
    import sys
    from io import StringIO 
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

MOD = 10**9 + 7
INF = 10**20
I = lambda:list(map(int,input().split()))
from collections import defaultdict as dd
from math import gcd

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


MOD = 10**9 + 7
INF = 10**20
I = lambda:list(map(int,input().split()))
from collections import defaultdict as dd

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

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())
rs=list(reversed(s))
count = 0

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


s = list(input())
rs=list(reversed(s))
count = 0

for i in range(len(s)):
    if s[i]!=rs[i]:
        count += 1
print(count-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):
'''input
10 2
7 6 18 6 16 18 1 17 17
6 9 3 10 9 1 10 1 5
'''

from sys import stdin, stdout
import gc
gc.disable()
 
import sys, time, threading


	
# main starts
string = stdin.readline().strip()
i = 0
j = len(string) - 1
count = 0
while i < j:	
	if string[i] != string[j]:
		count += 1
print(count)

'''input
10 2
7 6 18 6 16 18 1 17 17
6 9 3 10 9 1 10 1 5
'''

from sys import stdin, stdout
import gc
gc.disable()
 
import sys, time, threading


	
# main starts
string = stdin.readline().strip()
i = 0
j = len(string) - 1
count = 0
while i < j:	
	if string[i] != string[j]:
		count += 1
	i += 1
	j -= 1
print(count)

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

def kaibun(string):
    count = 0
    strli = list(string)
    for i in range(len(string)/2):
        if strli[i] == strli [-i-1]:
            continue
        else:
            count += 1
    return count

print(kaibun(S))

S = input()

def kaibun(string):
    count = 0
    strli = list(string)
    for i in range(len(string)//2):
        if strli[i] == strli [-i-1]:
            continue
        else:
            count += 1
    return count

print(kaibun(S))

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[-i-1]):
    count++

print(count)

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

S = str(input())
S_l = list(S)
rS = list(reversed(S))
count = 0

for i in range(len(S_l)):
    if(S_l[i] != rS[i]):
        count += 1
print(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):
import math
s = input()
S = s[::-1]
print(S)
count = 0
for i in range(0, len(s)):
  if s[i] != S[i]:
    count += 1
print(math.floor(count/2))

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

Verdicts: Wrong Answer

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

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

S = input()
a = 0
for i in range(len(S)//2):
  if S[i] != S[-i-1]:
    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=list(input())
if len(s)%2==0:
  c=len(s)/2
  d=i*(-1)-1
  sum=0
  for i in range(c):
    if s[i]!=s[d]:
      sum+=1
  print(sum)
else:
  sum2=0
  e=(len(s)-1)/2
  f=i*(-1)-1
  for i in range(e):
    if s[i]!=s[f]:
      sum2+=1
  print(sum2)

def resolve():
    S = input()
    s = len(S)
    count = 0
    if s%2 == 0:
        for i in range(s//2):
            if S[i] != S[(i+1)*-1]:
                count += 1
    else:
        for i in range((s-1)//2):
            if S[i] != S[(i+1)*-1]:
                count += 1
    print(count)
resolve()


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=[]

for i in s:
  l.append(i)
new_l = l[::-1]
print(new_l)

count=0
for a,b in zip(l,new_l):
  if a != b:
    count+=1
print(count)
   
  
  

s=input()

l=[]

for i in s:
  l.append(i)
new_l = l[::-1]

count=0
for a,b in zip(l,new_l):
  if a != b:
    count+=1
print(count)
   
  
  

s=input()

l=[]

for i in s:
  l.append(i)
new_l = l[::-1]

count=0
for a,b in zip(l,new_l):
  if a != b:
    count+=1
print(count//2)
   
  
  

Verdicts: Wrong Answer

Wrong Answer

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

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


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


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


Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
s = input("")
print(s)
i = 0
length = len(s)
# print(type(len))
# print(len)
count = 0
for i in range (0, length):
    if s[i] != s[length - i - 1]:
        count += 1

print(int(count / 2))

s = input("")
i = 0
length = len(s)
# print(type(len))
# print(len)
count = 0
for i in range (0, length):
    if s[i] != s[length - i - 1]:
        count += 1

print(int(count / 2))

Verdicts: Wrong Answer

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

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

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

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

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

s=list(input())
t=list(reversed(s))
a=0
x=0
for i in range(len(s)):
    a=(a+0 if s[x]==t[x] else a+1)
    x=x+1
print(a//2)

Verdicts: Wrong Answer

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

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

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

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

S = input()
count = 0
if len(S) % 2 == 0:
  for i in range(int(len(S)/2)):
    if S[i] != S[len(S)-1-i]:
      count = count + 1
else:
  for i in range(int(len(S)/2)):
    if S[i] != S[len(S)-1-i]:
      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):
s1=[x for x in input()]
s2=s1[::-1]

print(s1)
print(s2)

cnt=0
for i in range(len(s1)):
  if s1[i] != s2[i]:
    cnt+=0.5
print(int(cnt))

s1=[x for x in input()]
s2=s1[::-1]
cnt=0
for i in range(len(s1)):
  if s1[i] != s2[i]:
    cnt+=0.5
print(int(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]
cnt=0
for i in range(len(t)):
    if s[i]!=t[i]: cnt+=1
print(cnt)

s=input()
t=s[::-1]
cnt=0
for i in range(len(t)//2):
    if s[i]!=t[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 = list(open(0).read())
len_rev = len(s) // 2
cnt = 0
for i in range(len_rev):
  if s[i] != s[len(s)-i-1]:
    cnt += 1
print(cnt)

s = list(open(0).read())
len_rev = len(s) // 2
cnt = 0
for i in range(len_rev):
  if s[i] != s[-i-1]:
    cnt += 1
print(cnt)

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

Verdicts: Wrong Answer

Wrong Answer

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

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

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

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


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

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

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

def main():
  s=0
  S=input()
  N=len(S)
  for i in range(N//2);
    if S[i]!=S[N-1-i]:
      S[N-1-i]=S[i]
      s+=1
  print(s)
main()

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

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

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

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

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


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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
string = list(input())
length = len(string)
l = list()
if length % 2 ==0:
    for i in range (int(length/2),length):
        l.append(string[i])
    l.reverse()
else:
    for i in range (int(length/2)+1,length):
        l.append(string[i])
    l.reverse()
print(str(l))
result = 0
for i in range(len(l)):
    if not l[i] == string[i]:
        result = result + 1
print(result)

string = list(input())
length = len(string)
l = list()
if length % 2 ==0:
    for i in range (int(length/2),length):
        l.append(string[i])
    l.reverse()
else:
    for i in range (int(length/2)+1,length):
        l.append(string[i])
    l.reverse()
result = 0
for i in range(len(l)):
    if not l[i] == string[i]:
        result = 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):
S=str(input())

count = 0

l = list(S)

a = len(S)

b = a - 1

for i in a:
    if l(i) != l(b-i):
        count = count + 1

count = count/2

print(count)

S=int(input())

count = 0

l=[]

l = list(S)

a = len(l)

b = a - 1

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

count = count/2

print(int(count))

S=str(input())

count = 0

l=[]

l = list(S)

a = len(l)

b = a - 1

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

count = count/2

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

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

s = input()
l = len(s)
h = l // 2
lis1 = []
lis2 = []
for i in range(0, h + 1):
  lis1.append(s[i])
  lis2.append(s[-(i + 1)])
count = 0
for a, b in zip(lis1, lis2):
  if a != b:
    count += 1
print(count)

s = input()
l = len(s)
h = l // 2
lis1 = []
lis2 = []
for i in range(0, l + 1):
  lis1.append(s[i])
  lis2.append(s[-(i + 1)])
count = 0
for a, b in zip(lis1, lis2):
  if a != b:
    count += 1
print(count)

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

Verdicts: Wrong Answer

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):
import math
N = list(input())

def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

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

import math
N = list(input())

def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

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

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S=list(map(str,input()))
N=len(S)
cnt=0
SR=S[:]
SR.reverse()
print(*SR)
for i in range(N):
  if S[i]!=SR[i]:
    cnt=cnt+1
print(cnt//2)

S=list(map(str,input()))
N=len(S)
cnt=0
SR=S[:]
SR.reverse()
#print(*SR)
for i in range(N):
  if S[i]!=SR[i]:
    cnt=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):
str1 = input()
str2 = list(str1)
n = (int(len(str1)/2))
count = 0
for i in range(1, n+1):
    if(str2[i-1]!=str2[-1*i]):
    count = count+1        
print(count)

       
     

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


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


Verdicts: Runtime Error

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

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


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


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

print(ans)

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

print(ans)

s = input()
n = len(s)
nn = n//2
ans = 0
for i in range(nn):
    if not s[i] == s[n-i-1]:
        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()
len_S = len(S)
c = 0
s = len_S // 2
for i in range(s-1):
    if S[i] is not S[len_S-1 -i]:
        c += 1
print(c)


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


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


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


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


Verdicts: Wrong Answer

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):
a = input()
b = 0
for c, (i, j) in enumerate(zip(a, a[::-1])):
	if i != j:
    	b += 1

print(b//2 + b%2)

a = input()
b = 0
for i, j in zip(a, a[::-1]):
	if i != j:
		b += 1

print(b//2 + b%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()
l = [i for i in S] 
print(l)

count = 0

while len(l) > 1:
    #print(l.pop(0))
    #print(l.pop(-1))
    print(l)
    if l.pop(0) != l.pop(-1):
        count += 1
print(count)

S = input()
l = [i for i in S] 
count = 0

while len(l) > 1:

    if l.pop(0) != l.pop(-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()
a = reversed(s)
ans = 0

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

s = input()
a = s[::-1]
ans = 0

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

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

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

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

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()
sr = s[::-1]

ans = 0

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

w = input()
wr = w[::-1]

ans = 0
for i in range(len(w)//2):
  if w[i]!=wr[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)
n = N // 2
A = 0

if N % 2 == 0:
  T = S[:n]
  U = S[n::-1].reverse()
print(T)
print(U)

S = input()
N = len(S)
n = N // 2
A = 0

if N % 2 == 0:
  T = S[:n]
  U = S[:n-1:-1]
else:
  T = S[:n]
  U = S[:n:-1]
for i in range(n):
  if T[i] != U[i]:
    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 = input()

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

print(res)

s = input()

res = 0
for i in range(len(s)//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):
A = list(input())
B = round(len(A) / 2)
A.pop(B - 1)
R = 0
C = A[0:B-1]
D = A[-(B - 1):]
D.sort(reverse=True)
count = 0
for i in range(B - 1):
	if C[count] != D[count]:
	R += 1
	count += 1
print(str(R))

A = list(input())
import math
print(A)
B = math.ceil(len(A) / 2)
R = 0
print(B)
C = A[0:B]
D = A[-B:]
D = D[::-1]
count = 0
print(C)
print(D)
for i in range(B):
	if C[count] != D[count]:
		R += 1
	count += 1
print(str(R))

A = list(input())
B = round(len(A) / 2)
if len(A) % 2 != 0:
	A.pop(B - 1)
R = 0
C = A[0:B]
D = A[-B:]
D = D[::-1]
count = 0
for i in range(B - 1):
	if C[count] != D[count]:
		R += 1
	count += 1
print(str(R))

A = list(input())
import math
B = math.ceil(len(A) / 2)
R = 0
C = A[0:B]
D = A[-B:]
D = D[::-1]
count = 0
for i in range(B):
	if C[count] != D[count]:
		R += 1
	count += 1
print(str(R))

Verdicts: Runtime Error

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

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

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

S = input()
T = 0
K = len(S)//2 if len(S)%2 == 0 else len(S)//2+1
for i in range(K):
  if S[i] != S[K + i]:
    T+=1
print(T)

S = input()
T = 0
K = len(S)/2 if len(S)%2 == 0 else len(S)//2+1
for i in range(len(S)//2):
  if S[i] != S[K + i]:
    T+=1
print(T)

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

S = list(input())
R = list(reversed(S))
ans = 0
for i in range(len(S)):
    if S[i] != R[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 sys.stdin

s = stdin.readline().strip()
sl = len(s)

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

print(cnt)

#!/usr/bin/env python3
import sys

s = stdin.readline().strip()
sl = len(s)

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

print(cnt)

#!/usr/bin/env python3
from sys import stdin

s = stdin.readline().strip()
sl = len(s)

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

print(cnt)

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):
a = input()
hl = int(len(a)/2)
first = a[:hl]
last = a[:hl:-1]
ans = 0
for fi,la in zip(first,last):
    if fi != la :
        ans += 1
print(ans)

a = input()
hl = int(len(a)/2)
first = a[:hl]
last = a[:hl+(len(a)%2-1):-1]
ans = 0
# print(first)
# print(last)
for fi,la in zip(first,last):
    if fi != la :
        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 = int(input())
ans = 0
for i in range(len(S)):
  if S[i] != S[::-1][i]:
    ans += 1
print(ans)

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

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

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

s = str(input())
n = len(s)
cnt = 0
if n%2==0:
  for i in range(int(n/2)):
    if s[i]!=s[n-i-1]:
      cnt += 1
else:
  for i in range(int((n-1)/2)):
    if s[i]!=s[n-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):
S=list(input())
C=len(S)
#print(S)
#print(S[1])
D=0
for n in range(C):
        if S[n]!=S[C-n-1]:
            D=D+1
print(D/2)

S=list(input())
C=len(S)
#print(S)
#print(S[1])
D=0
for n in range(C):
        if S[n]!=S[C-n-1]:
            D=D+1
print(round(D/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()
s_len=len(s)
ans=0
for i in range(s_len//2):
    if ans[i]!=ans[s_len-1-i]:
        ans+=1
print(ans)

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

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

s=input()
ans = 0
for i in range(len(s)//2):
 if s[i] != s[len(s)-1-i]:
  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):
a=input()
b=a
c=b[::-1]
d=0
for i in range(len(a)):
  if a[i]!=c[i]:
    d+=1
  else:
    pass
print(d)
    
  


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


a=input()
b=a
c=b.reverse()
d=0
for i in range(a):
  if a[i]!=b[i]:
    d+=1
  else:
    pass
print(d)
    
  

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


Verdicts: Wrong Answer

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()
rS = "".join([S[-i] for i in range(1,len(S)+1) ])

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

S = input()
rS = "".join([S[-i] for i in range(1,len(S)+1) ])

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

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

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

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

print(count)


S=input()
S=list(S)

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

print(count)


Verdicts: Runtime Error

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

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


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

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


s = input()

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

l = len(s)
sen = l // 2
c = 0

for i in range(sen):
  s1 = s[i]
  s2 = s[l-i]
  
  if s1 != s2:
    c += 1
print(c)

s = input()

l = len(s)
sen = l // 2
c = 0

for i in range(sen):
  s1 = s[i]
  s2 = s[l-i-1]
  
  if s1 != s2:
    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
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float('INF')

def main():
    s = input()
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

import sys
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float('INF')

def main():
    s = input()
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

import sys
import math
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float('INF')

def main():
    s = input()
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

s = input()
ans = 0

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

print(ans)

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):
string = input()
lengch = len(string)
halfLengch = lengch // 2
  startString = list(string[:halfLengch + 1])
endString = list(string[halfLengch + 2::-1])
countHug = 0

for i in startString :
  for j in endString :
    if i != j :
      countHug += 1

print(countHug)

string = input()
lengch = len(string)
halfLengch = lengch // 2
startString = list(string[:halfLengch])
endString = list(string[:halfLengch - 1:-1])
countHug = 0
 
for i,j in zip(startString, endString) :
    if i != j :
      countHug += 1
 
print(countHug)

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,ele in enumerate(list(s)):
    print(ele,s[::-1][i])
    if ele != s[::-1][i]:
        count+=1

print(count//2)

s = input()
count = 0
for i,ele in enumerate(list(s)):
    if ele != s[::-1][i]:
        count+=1

print(count//2)

Verdicts: Wrong Answer

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

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

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