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

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:
        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)
    if num[0] == num[-1]:
        if num[1] == num[-2]:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
res = 0
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]:
        res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def PalindJudge(num):
    
    judge = 1
    list = [0,0,0,0,0]
    
    for i in range(5):
        list[i] = num%10
        num //= 10
        
    for i in range(3):
        if list[i]!=list[4-i]:
            judge *= 0
            
    return judge

if __name__ == '__main__':
    
    a,b = map(int, input().split())
    
    count = 0
    
    for i in range(a, b+1):
        if PalindJudge(i) == 1:
            count += 1
            
    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    A, B = map(int, open(0).read().split())
    print(
        len([0 for i in range(A, B + 1) if str(i) == "".join(list(reversed(str(i))))])
    )


main()

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
def check(s):
    an = True
    for i in range(len(s)//2):
        if s[i] != s[-i-1]:
            an = False
    return an    
a,b = map(int, input().split())
ans = 0
for i in range(a,b+1):
    l = str(i)
    l2 = list(l)
    if check(l2):
        ans += 1
print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

count=0

for i in range(A,B+1):
    i_str=str(i)
    ri_str=i_str[::-1]
    ri=int(ri_str)
    if i==ri:
        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 = list(map(int, input().split()))

c = 0

for i in range(a, b+1):
    s = str(i)
    f = True
    for j in range(len(s)):
        #print(s[j], s[-j], i)
        if s[j] != s[-j-1]:
            f = False
            break
    if f:
        #print(i)
        c += 1

print(c)

Submission status: Accepted

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

n = 0
for i in range(A,B+1):
    s = str(i)
    recursive = True
    for j in range(len(s)//2):
        if s[j] != s[len(s)-1-j]:
            recursive = False
            break
    if recursive:
        n += 1

print(n)

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]:
        if i[1] == i[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):
    a = list(str(i))
    if a == a[::-1]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def resolve():
    a, b = map(int, input().split())
    count = 0
    for num in range(a, b+1):
        snum = str(num)
        if snum[0] != snum[4] or snum[1] != snum[3]:
            continue
        else:
            count += 1
    print(count)
resolve()

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[0] == x[4] and x[1] == x[3]:
        cnt += 1
    else:
        continue
print(cnt)

Submission status: Accepted

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

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):
  s = str(i)
  judge = True
  for j in range(2):
    if s[j] != s[4-j]:
      judge = False
  if judge:
    ans += 1
    
print(ans)

Submission status: Accepted

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

cnt=0
for i in range(a,b+1):
    a = list(str(i))
    a.reverse()
    a="".join(a)
    if a == str(i):
        cnt += 1
    else:
        continue
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    A, B = [int(item) for item in input().split()]

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

    print(res)
if __name__ == "__main__":
    resolve()

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)[4] and str(i)[1] == str(i)[3]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from sys import stdin
from numpy import argmin

a,b = [int(x) for x in stdin.readline().split()]
cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
a=0
for i in range(A,B+1):
    if str(i)==''.join(list(reversed(str(i)))):
        a+=1
print(a)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(a,b+1):
    seki_gyaku = str(i)
    if seki_gyaku == seki_gyaku[::-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 = map(int, input().split())
r = range(a, b+1)
cnt = 0
for i in r:
    if str(i) == str(i)[::-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) :
  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())

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

Submission status: Accepted

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

cnt = 0
for i in range(A,B+1):
  si = str(i)
  checking = si[::-1]
  if si == checking and int(checking) <= B:
    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 == x[::-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 i//10000 == i%10 and (i//1000)%10 == (i//10)%10:
    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==i[::-1]:
        ans+=1
print(ans)

Submission status: Accepted

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

ans_list =[]

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

Submission status: Accepted

Solution code:
ans=0
A,B=map(int,input().split())
for i in range(A,B+1):
  k=str(i)
  if k[0]==k[4] and k[1]==k[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):
    use = str(i)
    if use[0] == use[4] and use[1] == use[3]: 
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
A=[int(x) for x in input().split()]
lower=A[0]//100
upper=A[1]//100
count=upper-lower+1
if A[0]>lower*100+int(str(lower)[0])+int(str(lower)[1])*10:
  count-=1
if A[1]<upper*100+int(str(upper)[0])+int(str(upper)[1])*10:
  count-=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def resolve():
    import sys
    input = sys.stdin.readline
    # row = [int(x) for x in input().rstrip().split(" ")]
    # n = int(input().rstrip())
    # s = input().rstrip()
    a, b = [int(x) for x in input().rstrip().split(" ")]

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


if __name__ == "__main__":
    resolve()

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[0] == i[4] and i[1] == i[3]:
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = 0
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]:
        ans += 1
print(ans)

Submission status: Accepted

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

ans = 0
for i in range(A, B + 1):
    a = str(i)
    b = ''
    for j in range(1, len(a) + 1):
        b += a[-j]
    if a == 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):
    x = str(i)
    y = x[::-1]
    if x == y:
        count += 1

print(count)

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

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] and s[1] == s[-2]:
            ans += 1
    print(ans)


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

Submission status: Accepted

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)
        for j in range(3):
            if s[j] != s[-1-j]:
                break
        else:
            ans += 1
    print(ans)


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

Submission status: Accepted

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)
        for j in range((len(s)+1)//2):
            if s[j] != s[-1-j]:
                break
        else:
            ans += 1
    print(ans)


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

Submission status: Accepted

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

sum = 0

for n in range(A, B+1):
    rev = 0
    m = n
    while n != 0:
        dig = n % 10
        rev = rev*10+dig
        n = n//10
    if(m == rev):
        sum += 1
print(sum)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[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):
    a = str(i)
    a_len = len(a)
    a_len_mid = len(a) // 2
    pre = a[:a_len_mid]
    pos = ''.join(list(reversed(a[(a_len_mid + 1):a_len])))
    #if pre in pos:
    if pos.startswith(pre):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
A,B = 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())
cnt = 0
for i in range(A,B+1):
    if list(map(int, str(i))) == list(map(int, str(i)))[::-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def is_palindrome(char) -> bool:
	char_reverse = char[::-1]

	if char == char_reverse:
		return True
	else:
		return False
	

def main():
	A, B = map(int, input().split())
	ans = 0

	for num in range(A, B + 1):
		result = is_palindrome(str(num))

		if result:
			ans += 1

	print(ans)

  
if __name__ == "__main__":
  	main()

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
lst=[0 for _ in range(10**4,10**5)]

for i,_ in enumerate(lst):
  w=str(10**4+i)
  if w[0]==w[-1] and w[1]==w[-2]:
    lst[i]=1

print(sum(lst[a-10**4:b+1-10**4]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Palindromic Numbers
A,B = map(int,input().split())
count = 0
for i in range(A,B+1):
    i = str(i)
    if i[0] == i[1] == i[3] == i[4] or (i[0] == i[4] and i[1] == i[3]):
        count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

Solution code:
A, B = 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())
ii = 0
for i in range(A,B+1):
    Is = str(i)
    if Is[0] == Is[4] and Is[1] == Is[3]:
        ii += 1
print(ii)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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[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):
  list_i = list(str(i))
  if list_i[0]==list_i[4] and list_i[1]==list_i[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):
  s = str(i)
  if s[0] == s[4] and s[1] == s[3]:
    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 list(str(i)) == list(str(i))[::-1]:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(1, 9 + 1):
    for j in range(10):
        for k in range(10):
            i, j, k = str(i), str(j), str(k)
            kaibun = int(i+j+k+j+i)
            if A <= kaibun and kaibun <= B:
                ans += 1

print(ans)

Submission status: Accepted

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

ans = 0

for i in range(100, 1000):
    S = str(i)
    P = S + S[1] + S[0]
    ans += A <= int(P) <= B

print(ans)

Submission status: Accepted

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

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==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:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b = inintm()

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


def a(num):
    list_a = []
    while num > 0:
        list_a.append(num % 10)
        num = num // 10
    return list_a

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
A,B=map(int, input().split())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = list(map(int, input().strip().split()))
c=0
for i in range(1,10):
    for j in range(10):
        for w in range(10):
            # TODO: write code... in range(10):
            if a<=i*10001+j*1010+w*100 and i*10001+j*1010+w*100<=b:
                c=c+1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B = LI()

    ans = 0

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

    print(ans)

if __name__ == '__main__':
    resolve()

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

res = 0

for i in range(100, 1000):
    s = str(i)
    t = s + s[1] + s[0]
    ti = int(t)
    if ti >= A and ti <= B:
        res += 1

print(res)

Submission status: Accepted

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

count = 0
for i in map(str, range(A, B+1)):
    if(i == 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())
ans=0
for i in range(A,B+1):
    temp=""
    tamp=i
    for j in range(len(str(i))):
        temp+=str(i%10)
        i=i//10
    if str(tamp)==temp:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# print(f"{a} {b}")

ans = 0
for i in range(a, b + 1):
    if str(i) == str(i)[::-1]:
        # print(f"{str(i)} {str(i)[::-1]}")
        ans += 1

# i = a
# print(str(i))
# print(str(i)[::-1])

print(ans)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
        cnt +=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

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

Submission status: Accepted

Solution code:
a,b = map(int , raw_input().split())
def f(u): return u == u[::-1]
count = 0
for u in range(a, b+1):
	if f(str(u)):count +=1
print count

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
s = ""
cnt = 0
for i in range(a, b+1):
    s = list(str(i))
    if s[0] == s[4] and s[1] == s[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)[:2] == str(i)[-1:-3:-1]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def get(s,t):
    return s // (10 ** (t - 1)) % 10


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

count = 0

for i in range(A,B+1):
    one = get(i,1)
    two = get(i,2)
    four = get(i,4)
    five = get(i,5)

    if one == five and two == four:
        count += 1

print(count)

Submission status: Accepted

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

    if res:
        count+=1

print(count)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
for nums in range(a,b+1):
    temp=str(nums)
    for j in range(len(temp)//2):
        if temp[j]!=temp[len(temp)-1-j]:
            break
        elif j==len(temp)//2-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 int(i / 10000) == i % 10:
        if int(i / 1000) % 10 == int(i % 100 / 10):
            cnt += 1

print(cnt)

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())
answer = 0
for i in range(A,B+1):
  if str(i) == str(i)[::-1]:
    answer += 1
print(answer)