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: Accepted

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

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def r(n):
    dlist = []
    while n:
        dlist.append(n % 10)
        n = n // 10
    return dlist == list(reversed(dlist))


def main():
    a, b = intin()

    ans = 0
    for i in range(a, b + 1):
        if r(i):
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def main():
    a, b = map(int, input().split())
    count = 0
    for i in range(a, b + 1):
        data = str(i)
        data_rev = data[::-1]
        if data == data_rev:
            count += 1
        # print(data, data_rev)

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n=b-a

k=0

for i in range(n+1):
  A=str(a)
  if A[0]==A[-1] and A[1]==A[-2]:
    k+=1
  else:
    k+=0
  a+=1
  
print(k)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
num = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            x = 10000 * i + 1000 * j + 100 * k + 10 * j + i
            if a <= x <= b:
                num += 1
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
A,B=map(int,input().split())
l=[int(str(i)+str(j)+str(i%10)+str(i//10)) for i in range(10,100) for j in range(10)]
l.sort()
s=bisect.bisect_left(l,A)
t=bisect.bisect_right(l,B)
print(t-s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_digit(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans


def is_palindromic(n):
    digit = get_digit(n)
    while n > 0:
        if (n % 10) == (n // 10**(digit - 1)):
            n %= 10**(digit - 1)
            n //= 10
            digit -= 2
        else:
            return False
    else:
        return True


A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    ans += 1 if is_palindromic(i) else 0
print(ans)

Submission status: Accepted

Solution code:
def ipt(N=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
        return [list(map(int,input().split())) for _ in range(N)]

cnt=0
A,B=ipt()
for i in range(A,B+1):
    if i//10000 == i%10 and (i//1000)%10 == (i%100)//10:
        cnt += 1
print(cnt)

Submission status: Accepted

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

cnt = 0
for n in range(A, B+1):
    if n//10000 == n%10 and (n//1000)%10 == (n//10)%10:
        cnt += 1

print(cnt)

Submission status: Accepted

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

cnt = 0
for n in range(A, B+1):
    n_s = str(n)
    n_s_rvs = n_s[::-1]
    if n_s == n_s_rvs:
        cnt += 1

print(cnt)

Submission status: Accepted

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

cnt = 0
for n in range(A, B+1):
    n_s = str(n)
    n_s_len = len(n_s)
    for i in range(n_s_len//2):
        if n_s[i] != n_s[n_s_len-i-1]:
            break
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]

ans = 0
for i in range(A, B + 1):
    s1 = str(i)
    s2 = s1[::-1]
    if s1 == s2:
        ans += 1

print(ans)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def pan(n):
    if len(n) == 0 or len(n) == 1:
        return True
    
    if n[0] != n[-1]:
        return False
    else:
        return pan(n[1:-1])



def solve():
    a,b = f()
    ans = 0
    for i in range(a, b+1):
        if pan(str(i)):
            ans += 1
    
    print(ans)

solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(a, b+1):
    if i//10000 == (i//1) % 10 and (i//1000) % 10 == (i//10) % 10:
        count += 1

print(count)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ab=[str(i) for i in range(a,b+1)]

ans_list=[]
for j in range(len(ab)):
    if ab[j][0]==ab[j][4] and ab[j][1]==ab[j][3]:
        ans_list.append(ab[j])

print(len(ans_list))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

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

for i in range(A,B+1):
    ls=list(map(int,list(str(i))))
    if ls[0]==ls[4] and ls[1]==ls[3]:
        count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def read_input():
    a, b = map(int, input().split())
    return a, b


def check_palindromic(x):
    s = str(x)
    rev = s[::-1]
    return s == rev


def submit():
    a, b = read_input()

    count = 0
    for i in range(a, b+1):
        if check_palindromic(i):
            count += 1

    print(count)

if __name__ == '__main__':
    submit()

Submission status: Accepted

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

for i in range(A,B+1):
    i = str(i)
    for j in range(len(i)//2+1):
        if i[j] != i[-j-1]:
            break
    else:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC090B - Palindromic Numbers
a, b = list(map(int, input().rstrip().split()))
count = 0
for i in range(a, b + 1):
    lst = list(map(int, list(str(i))))
    if lst[0] == lst[4] and lst[1] == lst[3]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
def ispalindrome(n):
	ok=True
	n=str(n)
	ok=(n[4]==n[0]) and (n[3]==n[1])
	return ok

a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
	if ispalindrome(i):
		cnt+=1
print(cnt)

Submission status: Accepted

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

def check_palindrome(n):
    n = str(n)
    for i, c in enumerate(n):
        if n[-1-i] == c:
            continue
        return False
    return True

ans = 0
for n in range(a, b+1):
    if check_palindrome(n):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	A, B = map(int, input().split())
	ans = 0
	for i in range(A, B+1):
		copy_i = str(i)
		add = 1
		for j in range(len(copy_i)//2):
			if copy_i[j] != copy_i[-j-1]:
				add = 0
				break
		ans += add
	print(ans)


if __name__ == '__main__':
	main()

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for i in range(A,B+1):
    num = list(map(int, str(i)))
    if num[0] == num[4] and num[1] == num[3]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s,l=input().split()
c=0
for i in range(int(s[:2]),int(l[:2])+1):
  for j in range(10):
    v="{}{}".format(i,j)+str(i)[::-1]
    if int(s)<=int(v)<=int(l):c+=1
print(c)

Submission status: Accepted

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

a, b = map(int, input().split())

ans = 0

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

print(ans)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

a, b = map(int, input().split())

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

print(cnt)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      x = 10000*i + 1000*j + 100*k + 10*j + i
      if a <= x <= b:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
import itertools
for i,j,k in itertools.product(range(0,10), repeat=3):
  if i == 0:
    continue
  x = 10000*i + 1000*j + 100*k + 10*j + i
  if a <= x <= b:
    ans += 1
print(ans)

Submission status: Accepted

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

li = []
for i in range(A, B + 1):
    if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
        li.append(i)
print(len(li))

Submission status: Accepted

Solution code:
a, b = list(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[3]:
        ans += 1
print(ans)

Submission status: Accepted

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

ans = 0

for i in range(a,b+1):
    x = str(i)
    for j in range(3):
        if j == 2:
            ans +=1
        if x[j]==x[-1-j]:
            continue
        else:
            break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

answer = 0

for i in range(A, B+1):
    if str(i) == str(i)[::-1]:
        answer += 1
print(answer)

Submission status: Accepted

Solution code:
A,B = [int(i) for i in input().split()]
c = 0
if 1 <= A <= 99999:
    if 1 <= B <= 99999:
        for p in range(A, B + 1):
            if p // 10000 == p % 10 and p // 1000 - 10 * ( p // 10000 ) == p % 100 // 10:
                c += 1
            elif p // 100 == p % 10:
                c += 1            
print(c)

Submission status: Accepted

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

ans = 0
for i in range(A, B+1):
    if i%10 == i//10000 and i//10%10 == i //1000%10:
        ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(str, input().split())
if int(A[0])+1 < int(B[0]):
    ans = (int(B[0]) - int(A[0]) - 1) * 10**2
    for i in range(int(A), (int(A[0])+1)*10000):
        a = str(i)
        if a[0] == a[4] and a[1] == a[3]:
            ans += 1
    for i in range((int(B[0])*10000), int(B)+1):
        b = str(i)
        if b[0] == b[4] and b[1] == b[3]:
            ans += 1

else:
    ans = 0
    for i in range(int(A), int(B)+1):
        a = str(i)
        if a[0] == a[4] and a[1] == a[3]:
            ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys

INF = float('inf')
MOD = 10 ** 9 + 7

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


def main():
    a, b = LI()
    print(sum([n == int(str(n)[::-1]) for n in range(a, b + 1)]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

nums = []

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

print(len(nums))

Submission status: Accepted

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

nums = [x for x in range(a, b+1) if str(x)[0] == str(x)[-1] and str(x)[1] == str(x)[-2]]
print(len(nums))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cou = 0
while A != (B + 1):
    Astr = str(A)
    if int(Astr[0]) == int(Astr[4]) and int(Astr[1]) == int(Astr[3]):
        cou = cou + 1
    A = A + 1
print(cou)

Submission status: Accepted

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

Submission status: Accepted

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

c = 0
for i in range(A, B+1):
	s = str(i)
	t = "".join(reversed(str(i)))
	if s == t:
		c += 1

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans=0
def check(m):
    s=str(m)
    rs=s[::-1]
    if s==rs:
        return 1
    else:
        return 0

a,b=map(int,input().split())
for i in range(a,b+1):
    ans=ans+int(check(i))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    para = True
    for j in range(len(str(i))//2):
        if str(i)[j] != str(i)[-j - 1]:
            para = False
            break
    if para:
        ans += 1
print(ans)

Submission status: Accepted

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

ans = 0
for a in range(A, B + 1):
    s15 = (a // 10000) == (a % 10)
    s23 = (a // 1000) % 10 == (a % 100) // 10

    if s15 & s23:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans=0
for i in range(A,B+1):
    i2=list(str(i))
    i3=list(reversed(i2))
    if i2==i3:
        ans+=1
    else:
        continue
print(ans)

Submission status: Accepted

Solution code:
def p(a,b):
  count=0
  for i in range(a,b+1):
    si=str(i)
    if si[0]==si[-1] and si[1]==si[-2]:
      count+=1
  return count

n,m=map(int,input().split())
print(p(n,m))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

count=0
for tmp in range(A, B+1):
    num=[]
    while tmp > 0:
        num.append(tmp % 10)
        tmp = tmp // 10
    
    if num[0]==num[4] and num[1]==num[3]:
        count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
num = []
for n in range(a,b+1):
    num.append(str(n))
count = 0
for i in range(len(num)):
    hantei = 0
    for j in range(len(num[i])//2):
        if num[i][j] == num[i][-(j+1)]:
            #print(num[i][j],num[i][-(j+1)],num[i])
            hantei += 1
    if hantei == len(num[i])//2:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().rstrip().split())
counter = 0
for i in range(A,B+1):
    now = i
    number = 0
    for j in range(5):
        tmp = now % 10
        number += tmp * 10**(4-j)
        now //= 10
    if number == i:
        counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
lists = list(range(A,B+1))
str_lists = list(str(lists[0]))
kaibun_lists = []
for i in range(len(lists)):
        for j in range(len(list(str(lists[i])))):
                kaibun = str(lists[i])[::-1]
        if lists[i] == int(kaibun):
                kaibun_lists.append(int(kaibun))
print(len(kaibun_lists))