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

if len(s) % 2 == 0:
    s1 = s[:len(s) // 2]
    s2 = s[:len(s) // 2 - 1:-1]
else:
    s1 = s[:len(s) // 2]
    s2 = s[:len(s) // 2:-1]

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
S=input()
if len(S)%2==0:
	S_left=list(S)[:int(len(S)/2)]
	S_right=list(S)[int(len(S)/2):][::-1]

else:
	S_left=list(S)[:int(len(S)//2)]
	S_right=list(S)[int(len(S)/2)+1:][::-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    s = S()
    ans = 0


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

    print(ans)
main()

Submission status: Accepted

Solution code:
moji = str(input())
N = len(moji)
FM = moji[:N//2]
if N % 2 == 0:
    LM = moji[-1:(N//2)-1:-1]
else:
    LM = moji[-1:(N//2):-1]
ct = 0

for i in range(N//2):
    if FM[i] != LM[i]:
        ct += 1

print(ct)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    S = input()

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


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

L = s[:n]
R = s[-n:][::-1]

for l, r in zip(L, R):
  if l != r:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from sys import exit
import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

s = input()

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

Submission status: Accepted

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

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

cnt = 0
for i in range(int(len(S)/2)):
    if S[i] == S[len(S)-1-i]:
        continue
    else:
        cnt += 1
        #print(i, S[i], S[len(S)-1-i])
print(cnt)

Submission status: Accepted

Solution code:
S = input()
ans = 0

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

Submission status: Accepted

Solution code:
s=list(input())
r=list(reversed(s))
c=0

for i in range(len(s)):
  if s[i]!=r[i]:
    c+=1

print(c//2)

Submission status: Accepted

Solution code:
S = input()
num = len(S)//2
if num % 2 == 0:
    for i in range(num):
        if S[i] == S[-i-1]:
            num -= 1
else:
    for i in range(num):
        if S[i] == S[-i-1]:
            num -= 1
print(num)

Submission status: Accepted

Solution code:
list_s = list(input())
count = 0
for i in range(0, len(list_s) // 2):
    if list_s[i] == list_s[0 - (i + 1)]:
        continue
    else: count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l, r = 0, len(s)-1
c = 0

while l < r:
    if s[l] != s[r]:
        c += 1

    l += 1
    r -= 1

print(c)

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:
A = input()
import math
times = math.ceil(len(A)/2)
count = 0
for i in range(times):
  if A[i] != A[len(A)-1-i]:
    count += 1
print(count)

Submission status: Accepted

Solution code:
S = input()
length = len(S)
if length % 2 == 0:
    length = int(length / 2)
    S_half_1 = S[:length]
    S_half_2 = S[(length):]
    S_half_2 = S_half_2[::-1]
else:
    length = int(length // 2)
    S_half_1 = S[:length]
    S_half_2 = S[(length + 1) :]
    S_half_2 = S_half_2[::-1]

ans = 0
for i in range(length):
    if S_half_1[i] != S_half_2[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 1
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"

S = v()

a = len(S)

if a % 2 == 0:
    ra = a//2
else:
    ra = a//2

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

print(cnt)

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

print(ans)

Submission status: Accepted

Solution code:
# ABC147

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

Submission status: Accepted

Solution code:
S = list(input())
cn = 0
T = S[::-1]


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

print(cn)

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(len(s)//2-ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
mid = len(s)//2
q = s[:mid]
if len(s)%2 == 0:
    t = list(s[mid:])
else:
    t = list(s[mid+1:])

t.reverse()
cnt = 0

for i in range(mid):
    cnt += s[i] != t[i]

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(input())
i = 0
res = 0
while i < len(A) // 2:
  if A[i] != A[len(A) - 1 -i]:
    res += 1
  i += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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


def main():
    S = input()
    n = len(S)

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
S1 = S[:len(S) // 2]
S2 = S[-1:(len(S)-1) // 2:-1]
ans = 0
for s1, s2 in zip(S1, S2):
    ans += s1!=s2
print(ans)

Submission status: Accepted

Solution code:
s = list(input())

s1 = s[:len(s)//2]
s2 = s[-(-len(s)//2):][::-1]

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

print(cnt)

Submission status: Accepted

Solution code:
s = list(input())

s1 = s[:len(s)//2]
s2 = s[-(-len(s)//2):][::-1]

cnt = 0
while True:
    if s1 == s2:
        break
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            s1[i] = s2[i]
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
a=str(input());ans=0
for i in range(len(a)//2):
    if a[i]!=a[len(a)-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=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()

s = list(s)

L = len(s)

l = len(s)//2

c = 0

for i in range(l):
  if s[i] != s[L-1-int(i)]:
    c += 1
    
print(c)

Submission status: Accepted

Solution code:
# coding: utf-8

str = input()
table = list(str)
count = 0
if len(str) % 2 == 0:
    for i in range(len(str)):
        if table[i] == table[(len(str)-1)-i]:
            continue
        else:
            count += 1
elif len(str) % 2 == 1:
    for i in range(len(str)):
        if table[i] == table[(len(str)-1)-i]:
            continue
        else:
            count +=1
if count == 0:
    print(0)
else:
    print(int(count / 2))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
s = input()
ln = len(s)
if ln%2 == 0:
    ml = ln//2 - 1
    mr = ln//2
    ans = 0
    for i in range(ml+1):
        #print(s[i],s[-i-1])
        if s[i] == s[-i-1]:
            pass
        else:
            ans += 1
else:
    m = ln//2
    ans = 0
    for i in range(m):
        if s[i] == s[-i-1]:
            pass
        else:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().strip()
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(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()
ans = 0
for i in range(len(s)):
    j = len(s)-i-1
    if i > j: break
    if s[i] != s[j]: ans += 1

print(ans)

Submission status: Accepted

Solution code:
S = input()

cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def SL(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

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

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()
if len(s)%2 == 1:
    s_0 = s[0:(len(s)//2)+1]
    m = s[::-1]
    s_1 = m[0:(len(s)//2)+1]
    
else:
    s_0 = s[0:(len(s)//2)]
    m = s[::-1]
    s_1 = m[0:(len(s)//2)]

ans = 0

for i in range(len(s_1)):
    if s_1[i] != s_0[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(S: str):
    return sum(S[i] != S[-(1 + i)] for i in range(len(S)//2))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(f'{solve(S)}')


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)-i-1]:
        ans+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans//2)

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    ans = 0

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

    print(ans // 2)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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()
moji = len(s)
if moji % 2 == 0:
    moji = int(moji/2)
else:
    moji = int((moji-1)/2)

answer = 0
for i in range(moji):
    if s[i] != s[len(s)-1-i]:
        answer += 1
print(answer)

Submission status: Accepted

Solution code:
s=input()

ans=0

tyu=len(s)//2

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

print(ans)

Submission status: Accepted

Solution code:
s = input()
reverse = s[::-1]

result = 0
while s != reverse:
    for i, c in enumerate(s):
        if c != reverse[i]:
            s = s[:i] + reverse[i] + s[i + 1:]
            reverse = s[::-1]
            result += 1
            break
print(result)

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s = input()

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

print(cnt)

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
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
for i in range(n//2):
    if s[i] != s[-(i+1)]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    S = _S()
    ans = 0
    for i in range(int(len(S)/2)):
        if S[i]==S[-i-1]:
            continue
        else:
            ans +=1
    print(ans)

main()

Submission status: Accepted

Solution code:
s = input()
cnt = 0

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

Submission status: Accepted

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

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = input()

l, r = 0, len(S)-1
count = 0
while l < r:
    if S[l] != S[r]:
        count += 1
    l += 1
    r -= 1

print(count)

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("YES") if fl else print("NO")
import collections
import math
import itertools
import heapq as hq

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ne=0

si=s[::-1]

for i in range(len(s)):
  if s[i] != si[i]:
    ne+=1


print(ne//2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print(cnt)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
cnt = 0
for s1, s2 in zip(s, s[::-1]):
    if s1 != s2:
        cnt += 1
print(cnt // 2)

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    s = input()
    t = s[::-1]
    n = len(s) // 2
    count = 0

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

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

S = sys.stdin.readline().strip()
ls = len(S)

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

print(ans)

Submission status: Accepted

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


def main():
    S = input().rstrip()
    rS = S[::-1]
    l = len(S)
    ans = 0
    for s1, s2 in zip(S[:l//2], rS[:l//2]):
        if s1 != s2:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import copy

s=list(input())

s2 = copy.copy(s)

s2.reverse()

ans = 0

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

Submission status: Accepted

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