Problem:


Score : 200 points

Problem Statement

Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.

Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Constraints

S is a string consisting of lowercase English letters.

The length of S is between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

Print the minimum number of hugs needed to make S palindromic.

Sample Input 1

redcoder

Sample Output 1

1

For example, we can change the fourth character to o and get a palindrome redooder.

Sample Input 2

vvvvvv

Sample Output 2

0

We might need no hugs at all.

Sample Input 3

abcdabc

Sample Output 3

2



Sample input:
redcoder


Sample output:
1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

print(summ)

Submission status: Accepted

Solution code:
s=input()

s=list(s)

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

Submission status: Accepted

Solution code:
s=list(input())
l=len(s)
ans=0
if l%2==1:
    half=(l-1)//2
    for i in range(half):
        if s[i]!=s[l-(i+1)]:
            ans+=1
else:
    half=l//2
    for i in range(half):
        if s[i]!=s[l-(i+1)]:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
S = str(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
S=str(input())
c=0

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    s = S()
    ols = len(s)
    ls = ols // 2
    ans = 0
    for i in range(ls):
        # print(s[i], s[ols-1-i])
        if s[i] != s[ols-1-i]:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
l = len(s)
if l%2 == 0:
	s1 = s[:l//2]
	s2 = s[l//2:]
else:
	s1 = s[:l//2]
	s2 = s[l//2+1:]
cnt = 0
s2 = s2[::-1]
for i in range(len(s1)):
	if s1[i] != s2[i]:
		cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
S = raw_input()

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

print ans

Submission status: Accepted

Solution code:
def main():
    S = input()
    count = 0
    for i in range(len(S)//2):
        if S[i] == S[len(S) - i - 1]:
            continue
        else:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

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

print(count)

Submission status: Accepted

Solution code:
s = input()
l = 0
r = len(s)-1
ans = 0
while l <= r:
  if s[l] != s[r]:
    ans += 1
  l += 1
  r -= 1
print(ans)

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()

str1 = str
str2 = str[::-1]

count = 0

for i in range(len(str1) // 2):
  if str1[i] != str2[i]:
    count += 1

print(count)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    n = len(S)
    is_even = True if n % 2 == 0 else False

    if is_even:
        front = S[:n//2]
        back = S[n//2:]
    else:
        front = S[:n//2+1]
        back = S[n//2:]
    count = 0

    for i, c in enumerate(reversed(back)):
        if front[i] != c:
            count += 1
    return count


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
s = input()
ans = 0
if len(s) %2 != 0:
    a = len(s)//2
    list1 = s[:a]
    list2 = s[a+1:]
    for i in range(a):
        if list1[i] != list2[-(i+1)]:
            ans +=1

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

c=0

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

print(c)

Submission status: Accepted

Solution code:
s = input()

n = len(s)

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
s = str(input())
i = 0
hug = 0
while (i < (len(s))/2):
    if (s[i] != s[len(s)-1-i]):
        hug += 1
    i += 1
print (hug)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['No', 'Yes']
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    S = input()
    stack = []
    ans = 0

    for i in range(len(S)//2):
        stack.append(S[i])

    start = 0
    if len(S) % 2 == 1:
        start = 1

    for i in range(len(S)//2+start, len(S)):
        a = stack.pop()
        if a != S[i]:
            ans += 1

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

length = len(s)

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
start = 0
end = len(S)-1
cnt = 0
while start < end:
    if S[start] != S[end]:
        cnt += 1
    start += 1
    end -= 1
print(cnt)

Submission status: Accepted

Solution code:
A=input()
count=0
for i,j in zip(A,A[::-1]):
    if i!=j:
        count+=1
print(int(count/2))

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
# 2019/12/08

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
a=[]
b=[]
for i in range(n//2):
    a.append(s[i])
i=0
for i in range(n//2):
    b.append(s[n-1-i])
c=0
for i in range(n//2):
    if a[i]==b[i]:
        pass
    else:
        c+=1
print(c)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str):
    answer = 0
    if len(S)%2 == 0:
        half  = len(S)//2
        for i in range(half,len(S)):
            if S[i] != S[len(S)-i-1]:
                answer += 1
    else:
        half  = len(S)//2
        for i in range(half+1,len(S)):
            if S[i] != S[len(S)-i-1]:
                answer += 1     
    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
from math import ceil
cnt = 0
for i in range(ceil(len(S)/2)):
    if S[i] != S[-i-1]:
        cnt += 1 
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
half = (n+1)//2
count = 0
for i in range(half):
    if(s[i]!=s[n-i-1]):
        count += 1

print(count)

Submission status: Accepted

Solution code:
n = input()

k = len(n) //2
count = 0

for j in range(k):
    if n[j] != n[-(j+1)]:
        count += 1


print(count)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    mid = len(S) // 2
    if len(S) % 2 == 0:
        a = S[:mid]
        b = S[mid:]
    else:
        a = S[:mid]
        b = S[mid+1:]

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
string = list(input())
print(sum(c1 != c2 for c1, c2 in zip(string[0:len(string) // 2], string[::-1][0:len(string) // 2])))

Submission status: Accepted

Solution code:
S = list(input())
lS = len(S)
count = 0
for i in range(lS//2):
    if S[i] != S[-1*(i+1)]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
s = input()
cnt = 0
while s!=s[::-1]:
    for i in range(len(s)):
        if s[i]!=s[len(s)-1-i]:
            s = s[:i]+s[len(s)-1-i]+s[i+1:]
            break
    cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str):
    ans=0
    for i in range(len(S)//2):
        if S[i] != S[(i+1)*(-1)]:
            ans+=1
    print(ans)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

i = 0
count = 0
q = len(S) - 1
while i < q:
    if S[i] != S[q]:
        count += 1
    i += 1
    q -= 1

print(count)

Submission status: Accepted

Solution code:
S = str(input())
i = 0
j = len(S) - 1
cnt = 0
while i < j:
    if S[i] != S[j]:
        cnt += 1
    i += 1
    j -= 1

print(cnt)

Submission status: Accepted

Solution code:
s = input()
n = len(s)

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

ans = 0
for c1, c2 in zip(reversed(s1), s2):
  if c1 != c2:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
import bisect
from collections import deque
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = True

def index(a,b):
    return str(min(a,b)) + "," +  str(max(a, b))

def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

    s = input()

    ans = 0

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

    print(ans)






if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
m = n // 2 if not n % 2 else n // 2 + 1
cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
s = input()
n = len(s) - 1
cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

S_R = S[::-1]

ans = 0
for s, sr in zip(S, S_R):
    if s != sr:
        ans += 1
        
print(ans//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
T=[e for e in S]
T.reverse()
N=len(S)
ans=0
for i in range(N//2):
  if S[i]!=T[i]:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)

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

print(count)

Submission status: Accepted

Solution code:
S = input()

n = len(S)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
# n = int(input())
# n,m,l = map(int, input().split())
s = input()
length = len(s)
half = length // 2 + length % 2
ans = 0
for i in range(half):
    if s[i] != s[length - i - 1]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

l = 0
r = len(S)-1

myans = 0
while l < r:
    if S[l] != S[r]:
        myans += 1
    l += 1
    r -= 1
print(myans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
n=len(S)

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

Submission status: Accepted

Solution code:
s = str(input())
S = []
for i in s:
    S.append(i)

S_rev = S[::-1]

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
def solve():
    S = list(input())
    s_reverse = S[::-1]
    ans = 0
    for i in range(len(S)):
        if S[i] != s_reverse[i]:
            ans += 1
    print(ans//2)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import math
S = input()
N = len(S)
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
s = input()
l = len(s) // 2

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
t = s[::-1]
ans = 0
for i,j in zip(s[:len(s)//2],t[:len(s)//2]):
  if i != j:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)
ans = 0
for i in range(l // 2 + l % 2):
    op = l-1-i
    if s[i] != s[op]:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
s = input()

cn = 0

n = len(s)//2
l = len(s)

for i in range(n):
    if(s[i] != s[l-i-1]):
        cn += 1
        
print(cn)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]

S = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

num = 0
for i, j in zip(s, s[::-1]):
    if i != j:
        num += 1

print(num // 2)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

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

Submission status: Accepted

Solution code:
def read_valus():
    return map(int, input().split())


def read_list():
    return list(read_valus())


def read_lists(N):
    return [read_list() for n in range(N)]


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
ans = 0
if len(s) % 2 == 0:
    head = s[0:len(s) // 2]
    tail = list(reversed(s[len(s) // 2:]))
    for i in range(len(head)):
        if head[i] != tail[i]:
            ans += 1
    print(ans)

else:
    head = s[0:len(s) // 2]
    tail = list(reversed(s[len(s) // 2 + 1:]))
    for i in range(len(head)):
        if head[i] != tail[i]:
            ans += 1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.buffer.readline

def main():
    # N = int(input())
    S = input().rstrip()
    # T1, T2 = map(int,input().split())
    # A1, A2 = map(int,input().split())
    # B1, B2 = map(int,input().split())
    # vA = list(map(int, input().split()))

    res = 0
    for s, r in zip(S, S[::-1]):
        if s != r:
            res += 1
    print(res//2)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
# print(S)

rs = reversed(S)
# print(rs)

result = 0
for i, char in enumerate(rs):
    if S[i] != char:
        result += 1

print(int(result/2))

Submission status: Accepted

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys

sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




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

if __name__ == "__main__":
    main() #endline===============================================

Submission status: Accepted

Solution code:
if __name__ == "__main__":
	S = input()
	count = 0
	for i in range(0, len(S) // 2):
		if S[i] != S[len(S) - 1 - i]:
			count += 1
	print(count)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S=input()
leng=len(S)
cnt=0

for i in range(leng//2):
  if S[i]==S[-1*i-1]:
    pass
  else:
    cnt+=1
    
print(cnt)

Submission status: Accepted

Solution code:
s=input()
ans=0

import math

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(count)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def examB():
    S = SI(); N =len(S)
    ans = N//2
    for i in range(N//2):
        if S[i]==S[N-1-i]:
            ans -=1
    print(ans)
    return

def examC():
    return

def examD():
    return

def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

Submission status: Accepted

Solution code:
S = input()
le = len(S)

s = 0
for i in range(le // 2):
    s += S[i] != S[le - 1 - i]

print(s)

Submission status: Accepted

Solution code:
S = input()

N = len(S)//2

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=-int(-len(s)//2)
print(sum(i!=j for i,j in zip(s[:n],s[::-1])))

Submission status: Accepted

Solution code:
def main():
    S = input()
    N = len(S)
    ans = 0
    if N & 1:
        for s, t in zip(S[:(N//2)], S[(N//2)+1:][::-1]):
            if s != t:
                ans += 1
    else:
        for s, t in zip(S[:(N//2)], S[(N//2):][::-1]):
            if s != t:
                ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
sr = s[::-1]
hugs = sum(1 for c, cr in zip(s, sr) if c != cr) // 2
print(hugs)

Submission status: Accepted

Solution code:
S = list(input())

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

if len(S)%2 == 0:
    print(ans//2)
else:
    print(ans//2+ans%2)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
S = input()

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

print(int(ans/2))

Submission status: Accepted

Solution code:
s = input()
n = len(s) // 2

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

print(c)