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:
def read():
    S = input().strip()
    return S,


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


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

Submission status: Accepted

Solution code:
s = input()

ctr = 0
for i in range(len(s)):
  left = i
  right = len(s) - 1 - i
  if left >= right:
    break
  else:
    if s[left] != s[right]:
      ctr += 1

print(ctr)

Submission status: Accepted

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




if __name__ == "__main__":
    main()

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

A = list(S[:len(S)//2])
B = list(reversed(S[len(S)//2:]))

count = 0
for i in range(len(A)):
    if A[i] == B[i]:
        continue
    else:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import sys
# input = sys.stdin.readline
s = input()
l = len(s)
count = 0
for i in range(l//2):
    if s[i]!=s[-i-1]:
        count += 1
print(count)
exit()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = read().rstrip()

T = S[::-1]

L = (len(S) + 1) // 2

answer = sum(x != y for x,y in zip(S[:L],T[:L]))
print(answer)

Submission status: Accepted

Solution code:
import math

str = input()
ans = 0
l = len(str)
#print(l)
if l % 2 == 1:  #奇数
  t = math.floor(l/2)
  d = str[0:t]
  dd = list(d)
  e = str[t+1:l]
  ee = list(reversed(e))
  #print(dd,ee)
  for i in range(t):
    if dd[i] != ee[i]:
      ans += 1
  print(ans)
  
else:  #偶数
  t = math.floor(l/2)
  d = str[0:t]
  dd = list(d)
  e = str[t:l]
  ee = list(reversed(e))
  #print(dd,ee)
  for i in range(t):
    if dd[i] != ee[i]:
      ans += 1
  print(ans)

Submission status: Accepted

Solution code:
import sys, os
import collections
import math

def solve(input_stream):
  line = input_stream.readline().strip()
  length = len(line)
  border_before = math.floor(length/2)
  border_after = math.ceil(length/2)
  
  before = line[0:border_before]
  after = line[border_after:length][::-1]

  ans = 0
  for a, b in zip(before, after):
    if a != b:
      ans += 1
  
  return [str(ans)]

  
  

if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

print(answer)

Submission status: Accepted

Solution code:
s = input()
s = list(s)

count = 0

while len(s) > 0:
    b = s.pop(0)
    if len(s) == 0:
        break
    a = s.pop()
    if b != a:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    s = list(sys.stdin.readline().rstrip())
    l = len(s)
    result = 0
    for i in range(l // 2):
         result += 1 if s[i] != s[l-1-i] else 0
    print(result)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

st = ns()
i = 0
n = len(st)
ans = 0
while i < n//2 :
    if st[i] != st[n-1-i]:
        ans += 1
    i += 1
print(ans)

Submission status: Accepted

Solution code:
s=input();print(sum(s[i]!=s[~i]for i in range(len(s)))//2)

Submission status: Accepted

Solution code:
def main():
    s = input()

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

    print(cnt//2)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
for f, l in zip(S, S[::-1]):
  if f != l: ans += 1

print(ans//2)

Submission status: Accepted

Solution code:
S = input()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0
##print(len(S))

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

print(count)

Submission status: Accepted

Solution code:
s = list(input())
l = len(s)
 
s1 = s[:int(l/2)]
s2 = s[-int(l/2):]
s2.reverse()
 
dif = 0
for i in range(int(l/2)):
  if s1[i] != s2[i]:
    dif += 1
 
print(dif)

Submission status: Accepted

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

Submission status: Accepted

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

s1 = s[:int(l/2)]
s2 = s[-int(l/2):]
s2.reverse()

dif = 0
for i in range(int(l/2)):
  if s1[i] != s2[i]:
    dif += 1

print(dif)

Submission status: Accepted

Solution code:
lis = input()
leng = len(lis)
count = 0
count_max = leng/2
out = 0

while count < count_max :
    if lis[count] != lis[leng-count-1] :
      out += 1
    count += 1
  
print(out)

Submission status: Accepted

Solution code:
str = input()
res = str[::-1]
counter = 0

for i in range(0, int(len(str)/2)):
    if res[i] != str[i]:
        counter += 1


print(counter)

Submission status: Accepted

Solution code:
S = input()
L = len(S)
R = int(L/2)
ans = 0

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

Submission status: Accepted

Solution code:
def main():
    S = input().encode()
    N = len(S) // 2
    print(sum(S[i] != S[-i - 1] for i in range(N)))


if __name__ == "__main__":
    main()

Submission status: Accepted

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


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


S = input()
n_half = len(S) // 2 - 1
ans = 0
for i, (a, b) in enumerate(zip(S, S[::-1])):
    if i > n_half:
        break
    if a != b:
        # print(a, b)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
S=input()


half=len(S)//2
hug=0

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

print(hug)

Submission status: Accepted

Solution code:
import math

if __name__ == "__main__":
    S = input()
    count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

a = len(S) / 2
b = len(S) % 2
x = 0

if b == 0:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1
else:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1

print(x)

Submission status: Accepted

Solution code:
s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
S = input()

mozi = list(S)

n = len(mozi)

count = 0

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

#print(S)
#print(mozi)
#print(n)
print(count)

Submission status: Accepted

Solution code:
def kaibun(data):
    str1 = data
    str2 = data[::-1]

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

    return count 

input_data = input()

print(kaibun(input_data))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S=input()
Skai=list(S)
Skai.reverse()
S=list(S)
num=len(S)
i=0
Slist =[]
Skailist =[]
for j in range (num):
	if S[j]!=Skai[j]:
		i+=1
		Skailist.append(Skai[j])
		Slist.append(S[j])
		if Slist==Skailist:
			print(len(Skailist))
			sys.exit()			
print(int(i/2))

Submission status: Accepted

Solution code:
text = input()

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

print(count)

Submission status: Accepted

Solution code:
S = input()
mid = len(S) // 2
change = 0
# for odd
if len(S) % 2 != 0:
  mid_index = mid
else:
  mid_index = mid
for i in range(0, mid_index):
    if S[i] != S[len(S) - i - 1]:
      change = change + 1
print(change)

Submission status: Accepted

Solution code:
#--import&define---------------------
import math

def yes():
    print("Yes")
def no():
    print("No")

def gusu(n):
    a = 0
    x = int(n/2)-1
    for i in range(x+1):
        if l[i]!=l[n-i-1]:
            a = a+1
    return a

def kisu(n):
    a=0
    x = int(n/2)-1
    for i in range(x+1):
        if l[i]!=l[n-i-1]:
            a = a+1
    return a
#--my_library--------------------------------
#mapを利用した入力
# x,y = map(int,input().split())

#forを利用した入力
#l = []
#for i in range():
#    l.append(int(input()))
#--以下解答---------------------------------
s = input()
l =list(s)
ans = 0

i=0
n=len(l)
flag = False

#偶数か奇数か見分ける
if n%2 == 0:
    flag = True

if flag == True:
    ans = gusu(n)
else:
    ans = kisu(n)

print(ans)

Submission status: Accepted

Solution code:
# redcoder
string = input()
n = len(string) - 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

l = len(S)
l2 = int(l/2)

count = 0
for i in range(0, l2):
  if S[i]!=S[l-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()

ans = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input()

a = list(data)

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

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
for i in range(int(len(S)/2)):
    if b[i]==b[-(i+1)]:
        pass
    else:
        a+=1
print(str(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
words = input()

if len(words)%2 == 0:
    slice_cnt = len(words)//2
    words_cut = [words[:slice_cnt], words[slice_cnt:][::-1]]
    
    set_list = list(map(len, [set([words_cut[0][i], words_cut[1][i]]) for i in range(slice_cnt)]))
    print(set_list.count(2))
    
else:
    slice_cnt = (len(words) -1)//2
    words_cut = [words[:slice_cnt], words[slice_cnt+1:][::-1]]
    
    set_list = list(map(len, [set([words_cut[0][i], words_cut[1][i]]) for i in range(slice_cnt)]))
    print(set_list.count(2))

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if n%2:
  ms,us=s[:(n-1)//2],s[:(n-1)//2:-1]
else:
  ms,us=s[:n//2],s[:n//2-1:-1]
ans=0
for a,d in zip(list(ms),list(us)):
  if a!=d:ans+=1
print(ans)

Submission status: Accepted

Solution code:


def main():
    hug = 0
    S = input()

    for i in range(int(len(S)/2)):
        if S[i] !=  S[len(S)-i-1]:
            hug = hug + 1
        
    print(hug) 
 
 
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    S = input()

    S_half_len = int(len(S) / 2 + 0.5)

    S1 = []
    for i in range(S_half_len):
        S1.append(S[i])

    S2 = []
    if len(S) % 2 == 1: S_half_len -= 1
    for i in range(S_half_len, len(S)):
        S2.append(S[i])
    S2.reverse()
    # print(S2[:])

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

    print('{}'.format(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
slen = int(len(s) / 2)
s1 = s[0:slen]
s2 = s[:-slen-1:-1]
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    S = input()
    if len(S)%2:
        sl,sr = S[:len(S)//2],S[:len(S)//2:-1]
    else:
        sl,sr = S[:len(S)//2],S[:len(S)//2-1:-1]
    count=0
    for _, (l,r) in enumerate( zip(sl,sr)):
        if l!=r:
            count+=1
    print(count)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import math
strS = input()

strA = strS[0:len(strS) // 2]
strB = strS[len(strS)+1:(len(strS)-1) // 2: -1]

result = 0
for i, j in zip(strA, strB):
    result += i != j

print(result)

Submission status: Accepted

Solution code:
def reverse(s): 
    return s[::-1] 
  
def countPalindrome(s): 
    count = 0
    rev = reverse(s) 
    for i in range(0,int(len(s)/2)):
      if s[i] != rev[i]:
        count = count + 1
    return count
    


          
s = str(input())
print(countPalindrome(s))

Submission status: Accepted

Solution code:
def main():
    S = input()

    S_half_len = int(len(S) / 2 + 0.5)

    S1 = []
    for i in range(S_half_len):
        S1.append(S[i])

    S2 = []
    if len(S) % 2 == 1: S_half_len -= 1
    for i in range(S_half_len, len(S)):
        S2.append(S[i])
        # print(S[i])
    S2.reverse()
    

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

    print('{}'.format(ans))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

stra = input()

leng = len(stra)
kai1 = ""
kai2 = ""

kai1 = stra[:math.ceil(leng / 2)]
kai2 = stra[leng // 2:]

new_kai2 = kai2[::-1]

res = 0

for i in range(len(kai1)):
    if kai1[i] != new_kai2[i]:
        res += 1

print(res)

Submission status: Accepted

Solution code:
a = list(input())
b = len(a)
c = int(b/2)
x = []
result = []
if b%2 == 0:
    A = a[:c]
    B = a[c:]
    BB = B[::-1]
    for v in range(c):
        if A[v] != BB[v]:
            result.append(v)
        else:
            x.append(v)
        
else:
    C = a[:c]
    D = a[c+1:]
    DD = D[::-1]
    for v in range(c):
        if C[v] != DD[v]:
            result.append(v)
        else:
            x.append(v)
print(len(result))

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
r = s[::-1]
c = 0

for i in range(len(s)):
  if not s[i] == r[i]:
    c += 1
    
print(int(c/2))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    S = input().rstrip()
    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 = list(input())
l = len(S)
c = l // 2
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
#文字の入力
A1 = input()
#文字列の長さ
mojisu = len(A1)
n = 1	
i = 0	#入れ替える回数カウント

#判定
while round(mojisu/2) >= n:
  if A1[n-1] != A1[mojisu-n]:
    i += 1
  n += 1

#出力
print(i)

Submission status: Accepted

Solution code:
n = input()
count = 0
first, second = n[:len(n)//2], n[(len(n)+1)//2:]
if first == reversed(second):
    print(count)
else:
    for x in range(len(first)):
        if first[x] != second[len(second)-x-1]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
S=input()
n=len(S)
SR=list(reversed(S))
hug=0

for i in range(int(n/2)):
    if S[i]==SR[i]:
        pass
    else:
        hug+=1

print(hug)

Submission status: Accepted

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

def print_ans(N):
    """Test Case
    >>> print_ans("redcoder")
    1
    >>> print_ans("vvvvvv")
    0
    >>> print_ans("abcdabc")
    2
    """
    ans = 0
    length = len(N)
    for i in range(length // 2):
        if N[i] != N[length -1 - i]:
            ans += 1
    print(ans)

    

if __name__ == '__main__':
    N = input().rstrip()
    print_ans(N)

Submission status: Accepted

Solution code:
S=input()
count=0
n=(len(S)+1)/2
n=int(n)

for a in range(n):
    if S[a]==S[len(S)-1-a]:
        count=count+0
    else:
        count=count+1

print(count)

Submission status: Accepted

Solution code:
s = input()

sr = s[::-1]
#m = list(s)
#mr = list(sr)
count = 0
for i in range(len(s)):
    if (s[i] != sr[i]):
        count += 1

print(int(count/2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a = input()
b = a
d = "".join(list(reversed(b)))
ans = 0
c = math.floor(len(a)/2)
if len(a) % 2 == 0:
    for i in range(c):
        if not b[i] == d[i]:
            ans += 1
else:
    for i in range(c):
        if not b[i] == d[i]:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = []

def kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            l.append(kaibun[-i-1])
            
a = input()
kaibun(a)
print(len(l))

Submission status: Accepted

Solution code:
s=input()
t=0

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

Submission status: Accepted

Solution code:
str = input()
count = 0
first_half, second_half = str[:len(str)//2], str[(len(str)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
# B - Palindrome-philia
s = input()

l = (int)(len(s))

sum = 0
for i in range(0, l):

    if i >= l - i:
        break

    if s[i] != s[l - i - 1]:

        sum += 1

print(sum)

Submission status: Accepted

Solution code:
put_s = input()
count = 0
f_half, s_half = put_s[:len(put_s)//2], put_s[(len(put_s)+1)//2:]
if f_half == reversed(s_half):
    print(count)
else:
    for x in range(len(f_half)):
        if f_half[x] != s_half[len(s_half)-x-1]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
char_list = list(input())
j = 0
k = 0
for i in range(len(char_list) // 2):
    j = j - 1
    if not char_list[i] == char_list[j]:
        k += 1
print(k)

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:
n=str(input())
length = len(n)

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

Submission status: Accepted

Solution code:
i = input()
count = 0
first_half, second_half = i[:len(i)//2], i[(len(i)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if first_half[x] != second_half[len(second_half)-x-1]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
ans = 0
if n % 2 == 0:
    for a, b in zip(s[:n//2], reversed(s[n//2:])):
        if a != b:
            ans += 1
else:
    for a, b in zip(s[:n//2], reversed(s[n//2+1:])):
        if a != b:
            ans += 1
print(ans)

Submission status: Accepted

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

#print(s[1])
count = 0
for j in range(0, len(s)):
    if s[j] != s_[j]:
        count += 1
print('{:.0f}'.format(count/2))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s=list(input())
n=len(s)
c=0

if n%2 == 0:
  m=int(n/2)
else:
  m=int((n-1)/2)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)
c =0

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

print(c)

Submission status: Accepted

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

ans=0

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

print(ans)

Submission status: Accepted

Solution code:
N = input()

a=0
l=len(N)

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

Submission status: Accepted

Solution code:
str = input()
chars = list(str)
input_len = len(chars)

count = 0
if input_len % 2 == 0:
  mid = input_len//2
  s1 = chars[0:mid]
  s2 = chars[mid:input_len]
  for x, y in zip(s1,s2[::-1]):
    if x != y:
      count += 1

else:
  mid = (input_len//2) + 1
  s1 = chars[0:mid-1]
  s2 = chars[mid:input_len]
  for x, y in zip(s1,s2[::-1]):
    if x != y:
      count += 1
print(count)

Submission status: Accepted

Solution code:
s = input()

print(sum(map(lambda i: 1 if s[i] != s[-(i+1)] else 0, range(len(s) // 2))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=input()
count=0

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

Submission status: Accepted

Solution code:
a = str(input())

n = len(a)//2
cnt = 0

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

Submission status: Accepted

Solution code:
S = input()
S_rev = S[::-1]
count=0

for i,j in zip(S, S_rev):
    if not i==j:
        count += 1

print(count//2)

Submission status: Accepted

Solution code:
import math
def is_palindrome(string):
    if string == string[::-1]:
        return True
    else:
        return False

string = input()
num = 0



if is_palindrome(string):

    print(num)



else:
    for i in range(math.floor(len(string)/2)):
        if string[i]==string[-(i+1)]:

            continue
        else:
            str_list = list(string)
            str_list[i]=str_list[-(i+1)]
            num +=1
    print(num)

Submission status: Accepted

Solution code:
from math import floor
s = input()

len_s = len(s)
len_s_d2 = floor(len(s) / 2)
cnt_hug = 0
for i in range(len_s_d2):
	if s == s[::-1]:
		break
	if s[i] != s[len_s - 1 - i]:
		if i == 0:
			s = s[len_s - 1] + s[1:]
		else:
			s = s[:i] + s[len_s - 1 - i] + s[i+1:]
		cnt_hug += 1

print(cnt_hug)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
s=input()
l=len(s)
count=0
#print(l)


if l%2==0:
    for i in range(0,int(l/2)):
        if s[i]!=s[(l-1)-i]:
            #print(i)
            #print("このときl-1は")
           # print(l-1)
            #print(s[i]+","+s[l-1])
            count+=1
        else:
            #print("こちらは")
            #print(i)
            #print("このときl-1は")
            #print(l-1)
            #print(s[i]+","+s[l-1])
            pass
            
else:
    N=Decimal(str(l/2)).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
    for i in range(0,int(N)):
        if s[i]!=s[(l-1)-i]:
            #print(i)
            #print("このときl-1は")
            #print(l-1)
            #print(s[i]+","+s[(l-1)-i])
            count+=1
            
        else:
            #print(i)
            #print("下の方でこのときl-1は")
            #print(l-1)
            #print(s[i]+","+s[(l-1)-i])
            pass

#print("count is")

print(count)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate#,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys

setrecursionlimit(10**6)
input=stdin.readline

s=input().rstrip()
l,r=0,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 = list(input())
length = len(s)
sum = 0

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

print(sum)

Submission status: Accepted

Solution code:
s = str(input())
k = 0

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

Submission status: Accepted

Solution code:
S = input()

num = len(S)

bra = ""
ket = ""
if (num == 1):
    print(0)
elif (num < 4):
    if (S[0] != S[int(num / 2) + (num % 2)]):
        print(1)
    else:
        print(0)
else:
    if (num % 2 == 0):
        bra = S[0:int(num/2)]
        ket = S[num:int(num/2) - 1:-1]
    else:
        bra = S[0:int(num/2)]
        ket = S[num:int(num/2) - 2:-1]

    count = 0
    for i in range(int(num/2)):
        if (bra[i] != ket[i]):
            count += 1

    print(count)