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

Submission attempts (in order):
S = input()

def palind(word):
  word = word.lower()
  return word[::-1] ==word

S_inv = palind(S)
out = 0
for i in S:
  if S[i] ! S_inv[i]:
    out = out + 1

print(out)
    

S = input()
S_inv = S[::-1]

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

print(out)

S = input()
S_inv = S[::-1]

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


S = input()
S_inv = S[::-1]

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

out = out // 2
print(out)


S = input()
S_inv = S[::-1]

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

out = out // 2
#if out % 2 == 1:
#  out == out // 2 + 1
#else:
#  out == out // 2 
print(out)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

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

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S = input()
hug = 0
if len(S) % 2 == 0:
  for i in range(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)
  

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

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)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
ess = input()
sse = ess[::-1]
hugs = 0
for i in range(0, len(ess)):
  if ess[i] != sse[i]: hugs += 1
    
print(hugs)

ess = input()
sse = ess[::-1]
hugs = 0
for i in range(0, len(ess)):
  if ess[i] != sse[i]: hugs += 1
    
print(int(hugs/2))


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = input()
index = 0
count = 0

while True:
    if len(n) / 2 < index:
        break
    if n[index] != n[(index*-1) - 1]:
        count += 1
    index += 1
print(count)

n = input()
index = 0
count = 0

while True:
    if len(n) / 2 <= index:
        break
    if n[index] != n[(index*-1) - 1]:
        count += 1
    index += 1
print(count)

Verdicts: Wrong Answer

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
from sys import stdin
input = list(stdin.readline().rstrip())

n = len(input)

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

print(cnt)

from sys import stdin
input = list(stdin.readline().rstrip())

n = len(input)

if n % 2 == 1:
    del input[n//2]
    n = len(input)
cnt = 0
for i in range(int(n/2)-1, -1, -1):
    if input[i] != input[n-i-1]:
        cnt += 1

print(cnt)

Verdicts: Runtime Error

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

Submission attempts (in order):
# input
S = input()

hag = 0

rS = S[::-1]

for s, rs in zip(S, rS):
    if s != rs:
        hag += 1

print(hag)


# input
S = input()

hag = 0

a = 0
b = len(S) - 1

while a < b:

    if S[a] != S[b]:
        hag += 1
    a += 1
    b -= 1

print(hag)

Verdicts: Wrong Answer

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

Submission attempts (in order):
x = input()
a = x[::-1]
b = 0
c = 0
d = len(x)

while b >= d:
  if x[b] == a[b]:
    c = c
    b = b + 1
  else:
    c = c + 1
    b = b + 1
c = int(c/2)
print(c)

x = input()
a = x[::-1]
b = 0
c = 0
d = int(len(x))
while b + 1 <= d:
  if x[b] == a[b]:
    c = c
    b = b + 1
  else:
    c = c + 1
    b = b + 1
c = int(c/2)
print(c)

Verdicts: Wrong Answer

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

Submission attempts (in order):
v

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

Verdicts: Runtime Error

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

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

S = [i for i in input()]
N = len(S)
f_counter = 0
for j in range(N):
    if S[j] != S[N-1-j]:
        f_counter += 1
counter = f_counter / 2
print('{:.0f}'.format(counter))

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()

result = 0
入力例1なら3文字目まで
for i in range(len(S) // 2):
  
  if S[i] != S[-(i + 1)]:
    result += 1
print(result)

S = input()

result = 0

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

Verdicts: Runtime Error

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

Submission attempts (in order):
import java.util.*;
public class Main{
  public static void main(String[] args){
    	Scanner s = new Scanner(System.in);
    	String word = s.nextLine();
    	int leng = word.length();
    	String re = word.reverse();
    	int c = 0;
    	for(i=leng-1; i<=0; i--){
          if(word.charAt(i) == re.charAt(i)){
            	continue;
          }else
            c++;
        }
    System.out.println(c/2);
  }
}

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)

Verdicts: Runtime Error

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

Submission attempts (in order):
s = input()
 
ans = 0
for i in range(len(s)):
  for j in list(range(len(s)))[::-1]:
    if j < i:
      return ans
    else:
      if s[i] != s[j]:
        ans += 1

s = input()

ans = 0
for i in range(len(s)):
  for j in list(range(len(s)))[::-1]:
    if j < i:
      return ans
    else:
      if s[i] != s[j]:
        ans += 1

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

Verdicts: Runtime Error

Runtime Error

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

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

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)

Verdicts: Wrong Answer

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

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

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()



len = int(len(s)/2)

input = s[:len]
reverse_s =s[::-1]
reverse_s=reverse_s[:len]

cnt = 0

for i in range(len):
    if input[i] != reverse_s[i]:
        cnt +=1

print(input)
print(reverse_s)
print(cnt)

s = input()



len = int(len(s)/2)

input = s[:len]
reverse_s =s[::-1]
reverse_s=reverse_s[:len]

cnt = 0

for i in range(len):
    if input[i] != reverse_s[i]:
        cnt +=1

# print(input)
# print(reverse_s)
print(cnt)

Verdicts: Wrong Answer

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

Submission attempts (in order):
s=input()
n=len(s)//2

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

print(cnt)


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

s1=s[:n]
s2=s[-n:]
s2=s2[::-1]

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

print(cnt)


Verdicts: Wrong Answer

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

Submission attempts (in order):
def actual(s):
    N = len(s)
    count_operation = 0

    for i in range(N):
        head = s[i]
        tail = s[N - 1 - i]

        if head != tail:
            count_operation += 1

    return count_operation / 2

s = input()
print(actual(s))

def actual(s):
    N = len(s)
    count_operation = 0

    for i in range(N):
        head = s[i]
        tail = s[N - 1 - i]

        if head != tail:
            count_operation += 1

    return int(count_operation / 2)

s = input()
print(actual(s))


Verdicts: Wrong Answer

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

Submission attempts (in order):
s = list(input())

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

print(count)

s = list(input())

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

print(count)

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
rev_s = reverse(s)

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

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

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

S = list(input())
Sinv = S[::-1]

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

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
S = [i for i in input()]
S_len = len(S)
ans = 0
if (S_len % 2 == 0):
    a = S[0:int(S_len / 2)]
    b = S[int(S_len / 2):S_len][::-1]
    print(a,b)
    for i,j in zip(a,b):
        if not i == j:
            ans += 1
        else:
            continue
else:
    a = S[0:int(S_len / 2)]
    b = S[int(S_len / 2) + 1:S_len][::-1]
    print(a,b)
    for i,j in zip(a,b):
        if not i == j:
            ans += 1
        else:
            continue
print(ans)

S = [i for i in input()]
S_len = len(S)
ans = 0
if (S_len % 2 == 0):
    a = S[0:int(S_len / 2)]
    b = S[int(S_len / 2):S_len][::-1]
    for i,j in zip(a,b):
        if not i == j:
            ans += 1
        else:
            continue
else:
    a = S[0:int(S_len / 2)]
    b = S[int(S_len / 2) + 1:S_len][::-1]
    for i,j in zip(a,b):
        if not i == j:
            ans += 1
        else:
            continue
print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
l = len(s)
c = 0

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

print(c)

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

Verdicts: Wrong Answer

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

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

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

Verdicts: Runtime Error

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

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

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
S=input()
L=len(S)
cnt=0
for i in range(L):
  if L[i] is not L[L-1-i]:
    cnt +=1
print(cnt)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
count = -1
realcount = 0
for i in k:
    count +=1
    if i!=S[count]:
        S.replace(S[count],i)
        realcount+=1
        if realcount == 0:
            real = 0
        else:
            real = realcount//2
print(real)

S = input()
k = S[::-1]
count = -1
realcount = 0
for i in k:
    count +=1
    if i!=S[count]:
        S.replace(S[count],i)
        realcount+=1
    if realcount == 0:
        real = 0
    else:
        real = realcount//2
print(real)

Verdicts: Runtime Error

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

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

s=input()
cnt=0

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

s=input()
cnt=0

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
s=input()
n=len(s)
sum=0

for i in range(n):
  if s(i)!=s(n-i-1):
    sum+=1
    print(sum//2)


s=input()
n=len(s)
sum=0

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


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

s=input()
n=len(s)
sum=0

for i in range(n):
  if s(i)!=s(n-i):
    sum+=1
    print(sum//2)

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


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
s=input()
cnt=0
for i in range(s.len()):
if(s[i]!=s[-1-i]):
cnt=cnt+1


print(cnt)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
S = list(map(int,input().split()))
len(S)=int(p)
t=0
for n in range(p):
  if S[n]=S[p-n-1]:
    continue
  else:
    t+=1
print(t)

S = input()
len(S)=p
t=0
for n in range(p):
  if S[n]=S[p-n-1]:
    continue
  else:
    t+=1
print(t)

S = input()
len(S)=p
t=0
for n in range(p):
  if S[n]=S[p-n-1]:
    continue
  else:
    t+=1
print(t/2)

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

S = list(map(int,input().split()))
len(S)=p
t=0
for n in range(p):
  if S[n]=S[p-n-1]:
    continue
  else:
    t+=1
print(t)

S = list(map(int,input().split()))
len(S)=p
t=0
for n in range(p):
  if S[n]=S[p-n-1]:
    continue
  else:
    t+=1
print(t/2)


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

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


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

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



Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

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

Submission attempts (in order):
s = input()
n = len(s) // 2
p = n
j = -1

for i in range(n):
    if n[i] == n[j]:
        p -= 1
    j -= 1

print(p)

s = input()
n = len(s) // 2
j = -1
t = 0

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

print(t)

Verdicts: Runtime Error

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

Submission attempts (in order):
def main(s):
    isEven = int(len(s)%2)
    ran = (len(s)-1)/2 if isEven else (len(s)/2)
    count = 0
    for i in range(ran):
        if s[i] != s[-(i+1)]:
            count += 1
    return count

s = input()
print(main(s))

def main(s):
    isEven = int(len(s)%2)
    ran = int((len(s)-1)/2 if isEven else (len(s)/2))
    count = 0
    for i in range(ran):
        if s[i] != s[-(i+1)]:
            count += 1
    return count

s = input()
print(main(s))

Verdicts: Runtime Error

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

Submission attempts (in order):
//aaaaa
aaaaaa//

S = input()

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

Verdicts: Runtime Error

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

Submission attempts (in order):
word=input()
word_rev=word[::-1]
cnt=0

for i in range(len(word)):
    
    if word[i]!=word_rev[i]:
        
        cnt+=1
        
print(cnt)

word=input()
word_rev=word[::-1]
cnt=0

for i in range(len(word)):
    
    if word[i]!=word_rev[i]:
        
        cnt+=1
        
print(int(cnt/2))

Verdicts: Wrong Answer

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

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

counter = 0
nstring = input()
rstring = nstring[::-1]
for i in range(len(nstring)):
  if nstring[i] != rstring[i]:
  	counter += 1
print(counter)

counter = 0
nstring = input()
rstring = nstring[::-1]
for i in range(len(nstring)):
  if nstring[i] != rstring[i]:
  	counter += 1
print(counter)

counter = 0
text = input()
if len(text) % 2 != 0:
    left = int(len(text)/2) + 1
    right = len(text) - int(len(text)/2)-1
else:
    left = int(len(text)/2)
    right = len(text) - int(len(text)/2)
left_p = text[:right]
right_p = text[left:]
for i in range(0, len(left_p)):
    if (left_p[i] != right_p[len(right_p)-i-1]):
        counter += 1
print(counter)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
# redcoder
string = input()
n = len(string) - 1
if n == 1:
	print(0)
    exit(0)
    
s = 0 
e = n
count = 0
while e > s:
	if string[e] != string[s]:
    	count += 1
    e -= 1
    s += 1

print(count)


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

Verdicts: Runtime Error

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

Submission attempts (in order):
S = input()

a = 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)

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)

Verdicts: Runtime Error

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

Submission attempts (in order):
k = input()
dismatch = 0
num = len(k)//2 + 1

n = 0
m = len(k)-1
for i in range(num):
  if k[n] != k[m]:
    dismatch += 1
  n += 1
  m -= 1
print(dismatch)

k = input()
dismatch = 0
num = len(k)//2 
if len(k) % 2 == 1:
  num += 1
  
n = 0
m = len(k)-1
for i in range(num):
  if k[n] != k[m]:
    dismatch += 1
  n += 1
  m -= 1
print(dismatch)

Verdicts: Wrong Answer

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

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

a=list(str(input()))
b=a[::-1]
cnt = 0
lst=[]
for i in range(len(a)):
  if a[i] != b[i] and b[i] not in lst:
    cnt+=1
    lst.append(b[i])
print(cnt)

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

Verdicts: Wrong Answer

Wrong Answer

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
    import sys
     
    s = sys.stdin.read().strip()
    c = 0
    l = len(s)
    for i in range(int(l/2)):
      if s[i] != s[l-i-1]:
        c += 1
    print(c)

import sys

s = sys.stdin.read().strip()
c = 0
l = len(s)
print(int(l/2))
for i in range(int(l/2)):
  if s[i] != s[l-i-1]:
    c += 1
print(c)


import sys

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

import sys

s = sys.stdin.read().strip()
c = 0
l = len(s)
for i in range(int(l/2)):
  if s[i] != s[l-i-1]:
    c += 1
print(c)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

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

Submission attempts (in order):
s=input()
count=0
i=0
while i<=(len(s) // 2):
	if s[i]!=s[-(i+1)]:
		count+=1
	i+=1
print(count)

s=input()
rev=s[::-1]
i=0
count=0

while i<len(s)/2:
	if s[i]!=s[::-i-1]:
		count+=1
	i+=1

print(count)

s=input()
i=0
count=0

while i<range(len(s)//2):
	if s[i]!=s[-(i+1)]:
		count+=1
	i+=1

print(count)

s=input()
count=0

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

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

s=input()
rev=s[::-1]
i=0
count=0

while i<len(s)//2:
	if s[i]!=s[::-(i+1)]:
		count+=1
	i+=1

print(count)

s=input()
rev=s[::-1]
i=0
count=0

while i<len(s)//2:
	if s[i]!=s[::-i-1]:
		count+=1
	i+=1

print(count)

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

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

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

print(ans)

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

print(ans)

Verdicts: Wrong Answer

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

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


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


Verdicts: Wrong Answer

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

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

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

Verdicts: Wrong Answer

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

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

A=input();print(sum(i!=j for i,j in zip(A,A[::-1])//2)

A=input();print(sum(i!=j for i,j in zip(A,A[::-1]))//2)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
str=input()
rts=str[int(len(str)/2):]
str=str[:int(len(str)/2)]
if(len(str)!=len(rts)):
  rts=rts[1:]
rts=rts[::-1]
cnt=0
i=0
for e in str:
  if(rts[i]!=e):
    cnt+=1
    i+=1
print(cnt)

str=input()
rts=str[int(len(str)/2):]
str=str[:int(len(str)/2)]
if(len(str)!=len(rts)):
  rts=rts[1:]
rts=rts[::-1]
cnt=0
i=0
for e in str:
  if(rts[i]!=e):
    cnt+=1
  i+=1
print(cnt)

Verdicts: Wrong Answer

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

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

a = input()
l = []
c = 0
for i in a:
  l.append(a)
n = len(a) // 2
for i in range(n):
  if l[i] != l[len(l) - i-1]:
    c += 1

a = input()
l = []
c = 0
for i in a:
  l.append(i)
n = len(a) // 2
for i in range(n):
  if l[i] != l[len(l) - i-1]:
    c += 1
print(c)

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
s = input()
r = s[::-1]
print(s, r)
cnt = 0
for i in range(len(s)):
    if s[i] != r[i]:
        cnt += 1
print(int(cnt / 2))

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
s = list(input())
sr = []
ans=0
m = len(s)/2

for i in s[::-1]:
    sr.append(i)


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

print(ans)

s = list(input())
sr = []
ans=0
m = len(s)//2

for i in s[::-1]:
    sr.append(i)


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

print(ans)

Verdicts: Runtime Error

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

Submission attempts (in order):
S = input()
count=0
if len(S)%2==0:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i>=len(S)//2:
      break
else:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i==len(S)//2:
      break
print(count)

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

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

Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
S = list(input())

A = []
for i in S:
    A.append(i)
ans = 0
for i in range(len(S)):
    if S[i] != A[i]:
        ans += 1
print(ans)

S = list(input())

A = []
for i in S:
    A.append(i)
ans = 0
S.reverse()
for i in range(len(S)):
    if S[i] != A[i]:
        ans += 1

print(ans//2)

Verdicts: Wrong Answer

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

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

import numpy as np

S=input()
n=len(S)
q=0
for i in range(n):
    if S[i]!=S[n-i-1]:
        q+=1
print("{}".format(q//2))

Verdicts: Wrong Answer

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

Submission attempts (in order):
S=input()
n=len(str(S))
if n%2=1:
  count=0
  m=int((n-1)/2)
  for i in range(0,m):
    if S[i]!=S[n-i-1]:
      count+=1
else:
  count=0
  m=int(n/2)
  for i in range(0,m):
    if S[i]!=S[n-i-1]:
      count+=1
      
print(count)


  

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

Verdicts: Runtime Error

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

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

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


Verdicts: Runtime Error

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

Submission attempts (in order):
#!/usr/bin/env python3

def main():
    S = input()
    S_re = list(reversed(S))
    S = list(S)

    print(S)
    print(S_re)

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


main()

#!/usr/bin/env python3

def main():
    S = input()
    S_re = list(reversed(S))
    S = list(S)

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


main()

Verdicts: Wrong Answer

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

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


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
import math
S = input()
s = list(S) 
count=0
N=int(math.ceil(len(s)/2))

for i in range(N):
 if not s[i]==s[N-i-1]:
  count+=1

print(count)


import math
S = input()
s = list(S) 
count=0
N=math.ceil(len(s)/2)

for i in N:
 if not s[i]==s[N-i-1]:
  count+=1

print(count)


import math
S = input()
s = list(S) 
count=0
N=int(math.ceil(len(s)/2))

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

print(count)


Verdicts: Wrong Answer

Runtime Error

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

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

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


Verdicts: Runtime Error

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

Submission attempts (in order):
s=input()
t=s[::-1]
num=0
for i in range(len(s)):
    if s[i]!=t[i]:
        num+=1
print(num)


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
s = input()
reverse_s = s[::-1]
cnt = 0
for i, j in zip(s, reverse_s):
    if i != j:
        cnt += 1
print(cnt)

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

Verdicts: Wrong Answer

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
S =input()
print(S)

print(len(S))
count = 0


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


S =input()
#print(S)

#print(len(S))
count = 0


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


Verdicts: Wrong Answer

Accepted