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:
import sys
from collections import deque
readline = sys.stdin.readline

S = readline().rstrip()

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(hug)

Submission status: Accepted

Solution code:
s = str(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:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.5 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:
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
bun=input()
l=len(bun)

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

Submission status: Accepted

Solution code:
s=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:
import sys

inf = float("inf")


def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

string = input()
length = len(string)
count = 0
for i in range(length//2):
    if string[i]!=string[~i]:
        count+=1
print(count)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()
mae = S[:len(S)//2]
ushi = S[len(S)//2:][::-1]
ans = 0
for i in range(min(len(mae), len(ushi))):
    if mae[i] != ushi[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()
point = 0
si = s[::-1]
for i in range(len(s)):
    if s[i] != si[i]:
        point += 1
print(point//2)

Submission status: Accepted

Solution code:
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
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()
    h = len(S) // 2
    s1 = S[:h]
    s2 = S[h:][::-1]
    # print(s1,s2)
    ans = 0
    for i in range(h):
        if s1[i] != s2[i]:
            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] != s[len(s)-1-i]:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
S=list(input())
R=S[::-1]

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = 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:
a = input()
b = "".join(reversed(a))
n = len(a)
cnt = 0

for x in range(n//2):
    if a[x] != b[x]:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#%%

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

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

ans = (ans)//2
print(ans)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
s = list(input())

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

print(count//2)

Submission status: Accepted

Solution code:
s =  input()

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

Submission status: Accepted

Solution code:
S = input()

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = 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 = str(input())

Sum = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

l = 0
r = len(S) - 1
answer = 0

while l < r:
    if S[l] != S[r]:
        answer += 1
    l += 1
    r -= 1

print(answer)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
S=list(input())
Sr=S[::-1]

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

l = len(S)

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

#a = list(map(int, input().split()))

s = input()
n = len(s)

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
s=input()
if len(s)%2==0:
    ans=0
    for i in range(len(s)//2):
        if s[i]!=s[-1-i]:
            ans+=1
    print(ans)
else:
    ans=0
    for i in range(len(s)//2):
        if s[i]!=s[-1-i]:
            ans+=1
        
    print(ans)

Submission status: Accepted

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

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

ans = 0
for s1, s2 in zip(S, reversed(S)):
    ans += s1 != s2
print(ans // 2)

Submission status: Accepted

Solution code:
#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	S = list(input())
	N = int(len(S) // 2)

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

if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input().strip()

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

print(ret)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s=list(S())

  a=s[:len(s)//2]
  if len(s)%2==0:
    b=s[len(s)//2:]
  else:
    b=s[len(s)//2+1:]

  # print(a)
  # print(b)

  ans=0
  a.reverse()

  for i in range(len(s)//2):
    x=a[i]
    y=b[i]

    if x!=y:
      ans+=1

  return ans

# main()
print(main())

Submission status: Accepted

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

print(int(cnt/2))

Submission status: Accepted

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



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

main()

Submission status: Accepted

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


def main():
    S = input().strip()

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

    print(ans)



if __name__ == '__main__':
    main()

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 = 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 = input()
n = len(s)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

print(cnt // 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

l = len(s)

ans = 0

a = l // 2

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

print(ans)

Submission status: Accepted

Solution code:
S = list(input().strip())

h = len(S) // 2

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC147 B

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)

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

Submission status: Accepted

Solution code:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

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

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

a = list(input())

count = 0

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

print(count)

Submission status: Accepted

Solution code:
S = 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:
import sys
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    s = S()
    cnt = 0
    for i in range(len(s)):
        if i >= len(s)//2:
            break
        if s[i] != s[len(s)-1-i]:
            cnt += 1
    print(cnt)

main()

Submission status: Accepted

Solution code:
S=input()
n=len(S)
ans=0
i=0
while i<n-1-i:
    if S[i]!=S[n-1-i]:
        ans+=1
    i+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

loopnum = len(s)//2
out = 0

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

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    lenth = len(s)
    ans = 0
    for i in range(lenth//2):
        if s[i]==s[len(s)-1-i]:
            pass
        else:
            ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

S = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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


def num_operations(s):
    res = sum(c != d for c, d in zip(s, s[::-1])) // 2
    return res


def main():
    s = input()
    res = num_operations(s)
    print(res)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

S = input()
N = len(S)

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

Submission status: Accepted

Solution code:
S = input()

l = len(S)

hug = 0

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

print(hug // 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
i = 0
j = len(s) - 1
c = 0

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
left = list(s[:n//2])
right = list(s[n//2+n%2:])[::-1]
ans = 0
for a,b in zip(left, right):
    ans += a!=b
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0
N = len(S)
skip = set()
for i in range(len(S)):
    if i not in skip and S[i] != S[N - 1 - i]:
        cnt += 1
        skip.add(N-1-i)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input().rstrip()
x=list(s)
i=0;
O=0;
j=len(x)-1;
while(i<j):
    if x[i]!=x[j]:
        O+=1;
    i+=1;
    j-=1;
print(O)

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

print(num)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=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:
import numpy as np
S = np.array(list(input()))
T = S[::-1]

print(np.count_nonzero(S != T) // 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(str(input()))
re_s = s[::-1]

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

S = input().strip()

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 = list(str(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(N // 2):
    ans += S[i] != S[-1-i]

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
Ss = input()

N = len(Ss)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input()
c = 0
for i in xrange(len(s)):
    j = len(s) - 1 - i
    if i < j and s[i] != s[j]:
        c += 1
print c

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = list(input())

res = 0

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

print(res)

Submission status: Accepted

Solution code:
s = input()

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

print(count)

Submission status: Accepted

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

print(c)

Submission status: Accepted

Solution code:
s = input()

leng = len(s)

trid = leng//2

cnt = 0

for i in range(trid):
    if s[i] == s[-i-1]:
        continue
    else:
        cnt += 1
        
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
N=len(s)
sl = s[:N//2]
sr = s[-N//2:][::-1]

ans = 0
for i,j in zip(sl, sr):
	if i!=j:
		ans += 1
print(ans)

Submission status: Accepted

Solution code:
s = 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()

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:
def main():
    S = input()
    a, b = 0, len(S) - 1
    r = 0
    while a < b:
        if S[a] != S[b]:
            r += 1
        a, b = a + 1, b - 1
    print(r)

main()

Submission status: Accepted

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

S=one_str()

half = len(S)//2

count=0
for h,t in zip(S[:half], S[half:][::-1]):
    if h!=t:
        count+=1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template


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


if __name__ == '__main__':
    main()

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