Problem:


Score : 200 points

Problem Statement

Find the number of palindromic numbers among the integers between A and B (inclusive).
Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.

Constraints

10000 \leq A \leq B \leq 99999

All input values are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the number of palindromic numbers among the integers between A and B (inclusive).

Sample Input 1

11009 11332

Sample Output 1

4

There are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.

Sample Input 2

31415 92653

Sample Output 2

612



Sample input:
11009 11332


Sample output:
4

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
count = 0
for i in range(A,B+1):
  i = str(i)
  num = 1
  if len(i)%2 == 0:
    num = 0
  if i[:len(i)//2] == i[len(i)//2+num:]:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
count = 0
for i in range(A,B+1):
  i = str(i)
  if i[:len(i)//2] == i[len(i)//2+1:]:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    if i%100==i//1000:ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ans = 0
for i in range(a+1,b+1):
    key = str(i)
    #print(key)
    if key[:2] == key[4]+key[3]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ans = 0
for i in range(a,b):
    key = str(i)
    #print(key)
    if key[:2] == key[4]+key[3]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = map(str,input().split())
La = [int(A[:3]),int(A[3:])]
Lb = [int(B[:3]),int(B[3:])]
L = 900 - (La[0] - 100) - (999 - Lb[0])
ch1 = int(A[1] + A[0])
ch2 = int(B[1] + B[0])
if Lb[1] <= ch2:
  L -= 1
if ch1 <= La[1]:
  L -= 1
print(L)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

cnt = 0
for i in range(A,B+1):
  s = str(i)
  half = len(s) // 2
  add = len(s) % 2
  #print(s,-1, s[0:half],-1, s[half+add:])
  if s[0:half] == s[half+add:]:
    cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cnt=0
for i in range(a,b):
    j=str(i)
    if j==j[::-1]:
        cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

c=0
for i in range(a,b+1):
  s=str(i)
  if s==reversed(s):
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

c=0
for i in range(a,b+1):
  s=str(i)
  s=list(s)
  if s==reversed(s):
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
A, B = map(str, input().split())
l = list(range(int(A), int(B)))
c = 0
for i in l:
  t = str(i)
  if t[0] == t[4] and t[1] == t[3]:
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
count = 0
for i in range(a,b):
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
# vim: fileencoding=utf-8


def main():
    a, b = map(int, input().split())
    c = 0
    for i in range(a, b + 1):
        #     s = str(i)
        #     r = "".join(reversed(list(s)))
        #     if s == r:
        #         c += 1
        if (i % 10) == (i // 10000) and (i % 100 // 10) == (i % 10000 // 10000):
            c += 1
    print(c)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

cnt=0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      num=int(str(i)+str(j)+str(k)+str(j)+str(i))
      if a<=num<=b:
        print(num)
        cnt+=1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())

cnt=0
for i in range(1,10):
  for j in range(1,10):
    for k in range(1,10):
      num=int(str(i)+str(j)+str(k)+str(j)+str(i))
      if a<=num<=b:
        cnt+=1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
    start = i // 1000
    end = i % 100
    if start == end:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cnt=0
for i in range(a,b):
  if i//10000 == i%10 and (i//1000)%10 == (i//10)%10:
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
A, B = input().split()

ans_list =[]

for i in range(int(A), int(B)):
    i_reversed = int(str(i)[::-1])
    if i_reversed == i:
        ans_list.append(i)
    i += 1
        
print(len(ans_list))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

count = 0
for i in range(a, b):
    str_i = str(i)
    if str_i[0] == str_i[4] and str_i[1] == str_i[3]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
print(abs((n-2)*(m-2)))

Submission status: Wrong Answer

Solution code:
#
# abc090 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11009 11332"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """31415 92653"""
        output = """612"""
        self.assertIO(input, output)


def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        s = str(i)
        if s[0] != s[-1] or s[1] != s[-2]:
            break
        else:
            ans += 1
    print(ans)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
#
# abc090 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11009 11332"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """31415 92653"""
        output = """612"""
        self.assertIO(input, output)


def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        s = str(i)
        if s[0] != s[-1] or s[1] != s[-1]:
            break
        else:
            ans += 1
    print(ans)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    if str(i)[:2] == str(i)[3:]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
ans=0
for i in range(A,B+1):
    s=str(i);l=len(s)//2
    if s[:l]==s[-l:]:ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
  s = [int(_) for _ in str(i)]
  if s==reversed(s):
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
count = 0
A,B = map(int,input().split())

for i in range(A,B+1):
    if str(i)[:2] == str(i)[3:]:
        count += 1
print(count)

Submission status: Wrong Answer

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

A, B = map(int, input().split())

ans = 0
tmp_left = ''
tmp_right = ''

for x in range(A, B + 1):
    tmp_left = str(x)[0] + str(x)[1]
    tmp_right = str(x)[-2] + str(x)[-1]
    if tmp_left == tmp_right:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

answer = 0
for i in range(a,b+1):
  checkNumber = str(i)
  count = 0
  for j in range(2): 
    if (checkNumber[j] == checkNumber[j+3]):
      count += 1

  if count == 2:
    answer += 1

print(answer)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
while a <= b:
    if str(a)[:2] == str(a)[3:]:
        c += 1
    a += 1
print(c)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
while a < b:
    if str(a)[:2] == str(a)[3:]:
        c += 1
    a += 1
print(c)

Submission status: Wrong Answer

Solution code:
A, B = map(int,input().split())

ans = 0
def palindrome(string): return 0 if string==string[::-1] else 1
for i in range(A, B):
    if palindrome(str(i)) == 0 :
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
t = 0

for i in range(a,b+1):
    if i % 100 == i // 1000:
        t += 1
    if i % 100 * 10 == i // 1000:
        t += 1

print(t)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
t = 0
for i in range(a,b+1):
    if i % 100 == i // 1000 or i % 100 * 10 == i // 1000:
        t += 1

print(t)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
t = 0
for i in range(a,b+1):
    if i % 100 == i // 1000:
        t += 1

print(t)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
res = sum(i // 1000 == i % 100 for i in range(A, B+1))
print(res)

Submission status: Wrong Answer

Solution code:
def check(i):
    i = str(i)
    return i[:2] == i[3:]

A, B = map(int, input().split())
res = sum(check(i) for i in range(A, B+1))
print(res)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
c = 0
for i in range(A,B+1):
  s = str(i)
  for j in range(len(s)//2):
    if s[j] == s[(j+1)*-1]:
      c+=1
print(c)

Submission status: Wrong Answer

Solution code:
import sys
A,B = map(int,input().split())
if not ( 10000 <= A <= B <= 99999 ):
    sys.exit()

count = 0
for I in range(A,B+1):
    print(I)
    if str(I) == str(I)[::-1]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import sys
A,B = map(int,input().split())
if not ( 10000 <= A <= B <= 99999 ):
    sys.exit()

count = 0
for I in range(A,B):
    if str(I) == str(I)[::-1]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
cnt = 0
import math

for i in range(a+1,b+1):
    if i%10 == math.floor(i/10000)%10 and math.floor(i/10)%10 == math.floor(i/1000)%10:
        cnt = cnt + 1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

ans = 0

while A!=B :
  if str(A)==str(A)[::-1]:
    ans = ans + 1
  else:
    ans = ans
  A = A + 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  s = str(i)
  if s[0] == s[4] and s[1] == s[2]:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from math import log2

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

def ii():
    return int(input())

def main():
    X, Y = mi()
    print(int(log2(Y)-log2(X))+1)
    


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
c = 0
while a < b:
    if str(a)[::-1] == str(a):
        c += 1
    a += 1
print(c)

Submission status: Wrong Answer

Solution code:
a,b = input().split()
count = 0

anum = int(a)
bnum = int(b)

# a = list(a)
# b = list(b)


for i in range(anum,bnum+1):
    stra = str(i)
    if stra[0:2] == stra[3:5]:
        count += 1
        
print(count)

Submission status: Wrong Answer

Solution code:
a,b = input().split()
count = 0

anum = int(a)
bnum = int(b)

# a = list(a)
# b = list(b)


for i in range(anum,bnum):
    stra = str(i)
    if stra[0:2] == stra[3:5]:
        print(stra[0:2])
        print(stra[3:])
        count += 1
        
print(count)

Submission status: Wrong Answer

Solution code:
a,b = input().split()
count = 0

anum = int(a)
bnum = int(b)

# a = list(a)
# b = list(b)


for i in range(anum,bnum):
    stra = str(i)
    if stra[0:2] == stra[3:5]:
        #print(stra)
        count += 1
        
print(count)

Submission status: Wrong Answer

Solution code:
a,b = input().split()
count = 0

anum = int(a)
bnum = int(b)

# a = list(a)
# b = list(b)


for i in range(anum,bnum):
    stra = str(i)
    if stra[0:2] == stra[3:5]:
        count += 1
        
print(count)

Submission status: Wrong Answer

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

def judge(k):
    n = str(k)
    return n[0] == n[4] and n[1] == n[3]

def solve(a,b):
    c = 0
    for i in range(a,b+1):
        if judge(i+1):
            c += 1
    return c 

def main():
    A,B = map(int,input().split())
    print(solve(A,B))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def judge(k):
    n = str(k)
    return n[0] == n[4] and n[1] == n[3]

def cumSum(n):
    c = 0
    for i in range(10000,n+1):
        if judge(i+1):
            c += 1
    return c 

def solve(a,b):
    return cumSum(b) - cumSum(a)

def main():
    A,B = map(int,input().split())
    print(solve(A,B))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def judge(k):
    n = str(k)
    return n[0] == n[4] and n[1] == n[3]

def cumSum(n):
    c = 0
    for i in range(10000,n):
        if judge(i+1):
            c += 1
    return c 

def solve(a,b):
    return cumSum(b) - cumSum(a)

def main():
    A,B = map(int,input().split())
    print(solve(A,B))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

su = abs(A -B)
count = 0
for i in range(A, B):
    aa =str(i)
    rslt = aa[::-1]
    if aa == rslt:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

su = abs(A -B)
count = 0
for i in range(A, B):
    aa =str(i)

    rslt = aa[::-1]
    int(rslt)
    if i == int(rslt):
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

su = abs(A -B)
count = 0
for i in range(A, B):
    aa =str(i)
    rslt = aa[::-1]
    rr = aa
    # print("rslt{}".format(rslt))
    # print("rr{}".format(rr))
    if rr == rslt:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

su = abs(A -B)
count = 0
for i in range(A, B):
    aa =str(i)
    rslt = aa[::-1]
    rr = aa
    # print("rslt{}".format(rslt))
    # print("rr{}".format(rr))
    if rr == rslt:
        count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
#aからｂの整数。
a,b = map(int,input().split())
count=0
for i in range(a,b):
    i = str(i)
    if i == i[::-1]:
        count +=1
    else :
        pass
print(count)

Submission status: Wrong Answer

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[4])*10+int(A[3])
e=int(B[4])*10+int(B[3])
count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
            ans=count_small
else:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)

Submission status: Wrong Answer

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])

count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+a+i*100>=int(A) and b*1000+b+i*100<=int(B):
            count_small+=1
            
else:
    for i in range(0,9):
        if a*1000+a+i*100>=int(A):
            count_small+=1
        if b*1000+b+i*100<=int(B):
                count_large+=1

ans=(b-a)*10+count_small+count_large
print(ans)

Submission status: Wrong Answer

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])

count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+a+i*100>=int(A) and b*1000+b+i*100<=int(B):
            count_small+=1
            
else:
    for i in range(0,9):
        if a*1000+a+i*100>=int(A):
            count_small+=1
        if b*1000+b*i*100<=int(B):
                count_large+=1

ans=(b-a)*10+count_small+count_large
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

def ReverseDigits(n):
    d = str()
    for i in range(5):
        d += str(n % 10)
        n = n // 10
    return(d)

ans = 0

for i in range(A, B):
    if str(i) == ReverseDigits(i):
        ans += 1
    else:
        pass

print(ans)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(0,99):
  for j in range(0,10):
    x=int(str(i)+str(j)+str(i)[::-1])
    if(a<=x and x<=b):
      ans+=1
    
print(ans)

Submission status: Wrong Answer

Solution code:
def is_kaibun(n):
    ns = [int(v) for v in str(n)]

    i = 0
    j = len(ns) - 1
    while i < j:
        if ns[i] != ns[j]:
            return False
        i += 1
        j -= 1

    return True


A, B = map(int, input().split())

count = 0
for i in range(A, B + 1):
    if is_kaibun(i):
        print(i)
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
def is_kaibun(n):
    ns = [int(v) for v in str(n)]

    i = 0
    j = len(ns) - 1
    while i < j:
        if ns[i] != ns[j]:
            return False
        i += 1
        j -= 1

    return True


A, B = map(int, input().split())

count = 0
for i in range(A, B):
    if is_kaibun(i):
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
def solve(n, m):

    ans = len([i for i in range(n, m+1) if str(i)[:2] == str(i)[:-2]])
    return ans

if __name__ == "__main__":
    n, m = [int(i) for i in input().split()]
    print(solve(n, m))

Submission status: Wrong Answer

Solution code:
def solve(n, m):

    ans = len([i for i in range(n, m+1) if i // 1000 == i % 100])
    return ans

if __name__ == "__main__":
    n, m = [int(i) for i in input().split()]
    print(solve(n, m))

Submission status: Wrong Answer

Solution code:
def solve(n, m):

    ans = sum([1 for i in range(n, m+1) if i // 1000 == i % 100])
    return ans

if __name__ == "__main__":
    n, m = [int(i) for i in input().split()]
    print(solve(n, m))

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
  print(i)
  A = str(i)
  if A[0] == A[-1] and A[1] == A[-2]:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
count = 0
for i in range(a, b):
  A = str(i)
  if A[0] == A[-1] and A[1] == A[-2]:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
count=0

for i in range(A, B, 1):
  s = str(i)
  a = int(s[4])
  b = int(s[3])
  c = int(s[1])
  d = int(s[0])
  
  if a==d and b==c:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
count=0

for i in range(10001, 100000, 1):
  s = str(i)
  a = int(s[4])
  b = int(s[3])
  c = int(s[1])
  d = int(s[0])
  
  if a==d and b==c:
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

cnt = 0

for i in range(A,B+1):
    
    Str = str(i)
    
    if Str[:2] == Str[3:]:
        cnt += 1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

cnt =0

for i in range(A,B+1):
    Str = str(i)
    
    if Str[0:2] ==Str[3:]:
        cnt += 1
        
print(cnt)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
count=0
for i in range(a+1,b+1):
    r = int(str(i)[::-1])
    if i == r:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

count=0
#10000<= a<=b <=99999

for i in range(a+1,b+1):
    r = int(str(i)[::-1])
    if i == r:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
ans=0
for i in range(A+1,B+1):
    if str(i)==str(i)[::-1]:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
counter = 0
for i in range(a, b+1):
  if str(i)[:2] == reversed(str(i)[3:]):
    counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
counter = 0
for i in range(a, b+1):
  if str(i)[:2] == str(i)[3:]:
    counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
  flag = True
  si = str(i)
  for j in range(len(si) // 2):
    if si[j] != si[-(j + 1)]:
      flag = False
  if flag:
    cnt += 1

Submission status: Wrong Answer

Solution code:
def resolve():
	a, b = map(int, input().split())
	ans = 0
	for i in range(a, b):
		v = str(i)
		if v == v[::-1]:
			ans += 1
	print(ans)
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
	a, b = map(int, input().split())
	ans = 0
	for i in range(a, b):
		v = str(i)
		d = len(v) // 2
		if v[:d] == v[d+1:]:
			ans += 1
	print(ans)
resolve()

Submission status: Wrong Answer

Solution code:
A,B=input().split()
count=0

def kaibun(S):
    length=len(S)
    if length%2==0 and S[0:length//2]==S[length//2:]:
        return True
    
    elif length%2!=0 and S[0:length//2]==S[length//2+1:]:
        return True
    
    
for i in range(int(A),int(B)+1):
    #print(i)
    #S=str(i)
    #length=len(S)
    #print(S[0:length//2])
    #print(S[length//2+1:])
    #print(kaibun(str(i)))
    
    if kaibun(str(i)):
        count+=1
        
        
print(count)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    s = str(i)
    sl = len(s) // 2
    
    if s[:sl] == s[-sl:]: ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    s = str(i)
    sl = len(s) // 2
    if s[:sl] == s[sl+1:]: ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
  n = str(i)
  if n[0] == n[-1] and n[-1] == n[-2]:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
ans = 0

for i in range(a-1,b+1):
  j1 = str(i)
  j2 = ''.join(list(reversed(j1)))
  if j1 == j2:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    c = list(str(i))
    L = len(c)
    if L%2 == 0:
        d = c[:int(L/2)]
        e = c[:int(L/2):-1]
    else:
        d = c[:int(L/2)]
        e = c[int(L/2)+1:]
        reversed(e)
    if d == e:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
a, b = list(map(int, input().split()))
count = 0

for i in range(a, b):
    strI = str(i)
    if strI[0] == strI[-1] and strI[1] == strI[-2]:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
a, b = list(map(int, input().split()))
count = 0

for i in range(a, b):
    i = str(i)
    if i[0] == i[-1] and i[1] == i[-2]:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
count = 0
for i in range(A,B+1):
  k = str(i)
  karray = list(map(int, k))
  if karray == karray.reverse:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
count = 0
for i in range(1,10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        for m in range(10):
          k = 10000*i + 1000*j +100*k +10*l + m
          if A <= k and k <= B:
            ka = str(k)
            karray = list(map(int, ka))
            if karray == karray.reverse:
              count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
count = 0
for i in range(1,10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        for m in range(10):
          k = 10000*i + 1000*j +100*k +10*l + m
          if A <= k and k <= B:
            ka = str(k)
            karray = list(map(int, ka))
            if karray[0]==karray[4] and karray[1]==karray[3]:
              count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int, input().split())
count = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      for l in range(0,10):
        for m in range(0,10):
          k = 10000*i + 1000*j +100*k +10*l + m
          if A <= k and k <= B:
            ka = str(k)
            karray = list(map(int, ka))
            if karray[0]==karray[4] and karray[1]==karray[3]:
              count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

count = 0
for q in range(A, B):
    if str(q) == str(q)[::-1]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

count = 0
for q in range(A, B):
    if list(str(q)) == list(reversed(str(q))):
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

count = 0
for q in range(A, B):
    w = str(q)
    if w[:2] == (w[-1] + w[-2]):
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

count = 0
for q in range(A, B):
    if str(q)[:2] == str(q)[-2:]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A, B = map(int, readline().split())
    ans = 0
    for i in range(A,B+1):
        s = str(i)
        if s[:2]==s[3:]:
            ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
ans = 0
for i in range(a+1, b):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    if str(a+i) == str(a+i)[::-1]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
count = 0
for i in range(B - A):
    letter = list(str(A+i))
    if letter[0]==letter[-1] and letter[1] == letter[-2]:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

ans = 0
for i in range(A, B+1):
    a = str(i)
    l = len(a)
    if a[:l//2] == a[l//2+1:]:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())

ans = 0
for i in range(A, B+1):
    a = str(i)
    l = len(a)
    if l % 2 == 1:
        if a[:l//2] == a[l//2+1:]:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def myAnswer(A:int,B:int)-> int:
   total = 0
   for i in range(A,B+1):
      tmp =str(i)
      if(tmp[:2]==tmp[3:]):
         total+=1
   return total

def modelAnswer():
   tmp=1
def main():
   A, B = map(int,input().split())
   print(myAnswer(A,B))

if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

counter = 0

for i in range(B-A+1):
    n = A + i
    s = list(str(n))
    st = ""
    for j in range(5):
        st += s[4-j]
    if A <= int(st) <= B:
        counter += 1
    else:
        continue

print(counter)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ans = 0
for i in range(a, b):
    i = str(i)
    if i == i[::-1]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
def kai(n):
    a=""
    for i in reversed(range(len(n))):
        a+=(n[i])
    if n==a:
        return True

a,b=input().split()
cnt=0
for i in range(1,int(b)-int(a)+1):
    if kai(str(int(a)+i)):
        cnt+=1

print(cnt)

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
ans = 0
for i in range(a+1 ,b+1):
    s = str(i)
    t = s[::-1]
    if s == t:
        ans +=1
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

ans = 0
for i in range(a, b + 1):
    s = str(i)
    if s[:2] == s[3:]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = il()
    ret = 0
    for n in range(A, B+1):
        n = list(str(n))
        if n[:len(n)//2] == n[len(n)//2+1:]:
            ret += 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  if str(i)==reversed(str(i)):
    c+=1
print(c)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a, b + 1):
    if i // 1000 == i % 100:
        c += 1
print(c)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())

def li(x):
    L = []
    while x > 0:
        L.append(x % 10)
        x = x // 10
    return L

sum = 0
for i in range(A,B):
    if (li(i)[0] == li(i)[4]) and (li(i)[1] == li(i)[3]):
        sum += 1
        
print(sum)

Submission status: Wrong Answer

Solution code:
import sys

def cnt(n):
    m = str(n)
    l = len(m)
    if l == 1: return n + 1
    tot = 0
    tot += pow(10, (l - 1) // 2) * (int(m[0]) - 1)
    tot += pow(10, l // 2) - 1 - pow(10, l // 2 - 1) * (l & 1 ^ 1)
    while l >= 2:
        l -= 2
        if l == 0: tot += m[1] >= m[0]
        elif l == 1: tot += int(m[1]) + 1 - (m[-1] < m[0])
        else:
            m = str(int(m[1:-1]) - (m[-1] < m[0]))
            m = '0' * (l - len(m)) + m
            tot += int(m[0]) * pow(10, (l - 1) // 2)
    return tot

a, b = map(int, sys.stdin.readline().split())

def main():
    print(cnt(b) - cnt(a-1))

if __name__ ==  '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x,y=(int(i) for i in input().split())  
ans=[]
count=0
for i in range(x,y):
	n=str(i)
	if n[0]==n[-1] and n[1]==n[-2]:
		count +=1
print(count)

Submission status: Wrong Answer

Solution code:
def isp(str): return True if str == str[::-1] else False
a,b= map(int, input().split())
ans=0
for i in range(a,b+1):
  i_s=str(i)
  if isp(i_s):
    print(i)
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
x = 0

for i in range(a, b-1):
    if str(i)==str(i)[::-1]:
        x+=1

print(x)