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

counter = 0

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def bb090():
    a,b = list(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)

bb090()

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B] = string_to_int(inputs[0])
    count = 0
    for n in range(A, B+1):
        s = str(n)
        front = []
        back = []
        if len(s) % 2 == 0:
            half = len(s) // 2
            front = list(s[:half])
            back = list(s[half:])
        else:
            half = len(s) // 2
            front = list(s[:half])
            back = list(s[half+1:])
        if front == list(reversed(back)):
            count += 1
    return count


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

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:
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())
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())
c = 0
for i in range(a, b + 1):
    s = str(i)
    if s == s[::-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):
  j = str(i)[::-1]
  if i == int(j):
    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%10 and (i%10000)//1000 == (i%100)//10:
        count += 1

print(count)

"""
    print(i//10000)
    print(i%10)
    print((i%10000)//1000)
    print(i%100//10)
"""

Submission status: Accepted

Solution code:
def is_palindromic(num):
    tmp = list(str(num))
    while len(tmp) != 1:
        if tmp[0] == tmp[-1]:
            tmp.pop(0)
            tmp.pop(-1)
        else:
            return False
    return True


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

print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    forwards = list(str(i))
    backwards = list(reversed(forwards))
    if forwards == backwards:
        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)[:2] == str(i)[4:2:-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 str(i)[:: -1] == str(i):
        count += 1
    else:
        pass

print(count)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
def kaibunsu(X):
  a = X//10000
  b = (X - a*10000)//1000
  c = (X - a*10000 - b*1000)//100
  d = (X - a*10000 - b*1000 - c*100)//10
  e = X - a*10000 - b*1000 - c*100 - d*10
  x = e*10000 + d*1000 + c*100 + b*10 + a
  return x
count = 0
for i in range(A,B+1):
  if i == kaibunsu(i):
    count += 1
print(count)

Submission status: Accepted

Solution code:
# ABC090 B - Palindromic Numbers
a,b = map(int,input().split())

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

Submission status: Accepted

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

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

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

# output
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = A
ans = 0
while c <= B:
    c_str = str(c)
    if c_str[0] == c_str[-1]:
        if c_str[1] == c_str[-2]:
            ans += 1
    c += 1
    
print(ans)

Submission status: Accepted

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

cnt = 0

for num in range(a, b + 1):
    s = str(num)
    k = len(s) // 2
    isOk = True
    for c in range(k):
        if s[c] != s[-c-1]:
            isOk = False
            break
    
    if isOk:
        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 s in range(A,B+1):
  if str(s) == str(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):
    s=str(i)
    if s==s[::-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 str(i)[::-1] == str(i):
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC090B - Palindromic Numbers
def main():
    A, B = tuple(map(int, input().split()))
    ans = sum(str(i) == str(i)[::-1] for i in range(A, B + 1))
    print(ans)


if __name__ == "__main__":
    main()

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:
def roop(n):
  s=str(n)
  if s==s[::-1]:
    return 1
  else:
    return 0

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

ans=0
for i in range(A,B+1):
  ans+=roop(i)
print(ans)

Submission status: Accepted

Solution code:
s=list(input().split())
a=int(s[0])
b=int(s[1])
count=0
for i in range(a,b+1):
    number=list(str(i))
    antinumber=list(reversed(number))
    if int(''.join(number))-int(''.join(antinumber))==0:
        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=list(str(i))
    key="Yes"
    for j in range(len(s)//2):
        if s[j]!=s[len(s)-1-j]:
            key="No"
            break
    if(key=="Yes"):
        cnt+=1
print(cnt)

Submission status: Accepted

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

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())
print(sum([i == i[::-1] for i in map(str,range(a,b+1))]))

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

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)
    if s == s[::-1]:
        ans += 1

print(ans)

Submission status: Accepted

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

ans = 0
for i in range(A, B+1):
    buf = str(i)
    is_par = True
    for u in range(len(buf)//2):
        if buf[u] != buf[-1-u]:
            is_par = False
            break
    if is_par:
        ans += 1


print(ans)

Submission status: Accepted

Solution code:
# TLE?

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

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

print(ans)

Submission status: Accepted

Solution code:
def is_circular(n):
    s = str(n)
    l = len(s)
    for i in range(l//2):
        if s[i] != s[l-i-1]:
            return False
    else:
        return True

A, B = (int(x) for x in input().split())
print(sum(1 for i in range(A, B+1) if is_circular(i)))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for x in range(A, B+1):
    if int("".join(list(reversed(str(x))))) == x:
        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())
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().strip().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 str(i) == str(i)[::-1]:count += 1
print(count)

Submission status: Accepted

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


# Ar = int(A[::-1])
A = int(A)
B = int(B)

# print(Ar)
# print(A)
# print(B)

count = 0
while A <= B:
  As = str(A)
  Ar = int(As[::-1])

  if A == Ar:
    # print("Yes")
    count+=1
  A +=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for i in range(A, B+1):
    kaibun = str(i)
    for j in range(len(kaibun) // 2):

        if kaibun[j] != kaibun[-1-j]:
            break
        elif j == (len(kaibun) // 2) - 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):
    if str(i) == str(i)[::-1]:
        C += 1
print(C)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
cnt = 0
def kaibun(n):
    s = str(n)
    rs = reversed(s)
    for i,j in zip(s,rs):
        if i != j:
            return False
    return True
for i in range(a, b+1):
    if kaibun(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):
    s = str(i)
    if s[0]==s[-1] and s[1]==s[-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):
    moji = str(i)
    if moji[0]==moji[4] and moji[1]==moji[3]:
          ans += 1
print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
pal = [10001, 1010, 100]
count = 0

for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            if A <= pal[0] * i + pal[1] * j + pal[2] * k <= B:
                count += 1
            else:
                continue

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)[:len(list(str(i)))//2] == str(i)[len(list(str(i)))//2+1:][::-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):
  count += (1 if str(i) == str(i)[::-1] else 0)

print(count)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
AB = list(range(A, B+1))
N = B-A+1
count = 0

for i in range(N):
  count += (1 if str(AB[i]) == str(AB[i])[::-1] else 0)

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
l, r = map(int, input().split()); res = 0
for i in range(l, r + 1):
  if str(i) == str(i)[: : -1]:
    res += 1
print(res)

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

Submission status: Accepted

Solution code:
def main():
  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)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
# ABC090b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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())
counter = 0
for num in range(a, b+1):
  if str(num) == str(num)[::-1]:
    counter += 1
print(counter)

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for n in range(a, b+1):
    s = str(n)
    l = len(s)
    ok = True
    for i in range(l):
        if s[i] != s[l-1-i]:
            ok = False
            break
    if ok:
        ans += 1
print(ans)

Submission status: Accepted

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

print(num)

Submission status: Accepted

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

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())
sum=0
for i in range(b-a+1):
  if int(str(a+i)[0])==int(str(a+i)[4]) and int(str(a+i)[1])==int(str(a+i)[3]):
    sum+=1
print(sum)

Submission status: Accepted

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

counter = 0
for num in range(A,B+1):
  num_str = str(num)
  num_str_rev = num_str[::-1]
  if num_str == num_str_rev:
    counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
for i in range(a, b + 1):
  j = str(i)
  k = list(reversed(j))
  k = "".join(k)
  # print(j, k)
  if j == k:
    count += 1
print(count)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L =[0 for i in range(100000)]
for i in range(100000):
  N = i
  a = N//10000
  b = (N//1000)%10
  d = (N//10)%10
  e = N%10
  
  if a == e and d == b:
    L[i] = 1

A, B = map(int, input().split())
print(sum(L[A:B+1]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cnt = 0
for s in range(A, B+1):
    s = str(s)
    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())
c = 0
for i in range(a, b+1):
    koko = str(i)
    if koko == koko[::-1]:
        c += 1
print(c)

Submission status: Accepted

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

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B = map(int, input().split())

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

        print(ans)


if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

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

Submission status: Accepted

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

def is_palindrome(S):
    for i in range(len(S) // 2 ):
        if S[i] != S[len(S) - i - 1]:
            return False
    return True

ans = 0
for i in range(A, B + 1):
    if is_palindrome(str(i)):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
print(sum(s[0]==s[4]for s in map(str,range(*map(sum,enumerate(map(int,input().split())))))if s[1]==s[3]))

Submission status: Accepted

Solution code:
print(sum(s[0]==s[4]and s[1]==s[3]for s in map(str,range(*map(sum,enumerate(map(int,input().split())))))))

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

Submission status: Accepted

Solution code:
a,b=input().split()
f=lambda x:int(x[:3]+x[1]+x[0])
print(int(b[:3])-int(a[:3])+1-(f(a)<int(a))-(f(b)>int(b)))

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

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:
def is_palindrome(num):
    return str(num) == str(num)[-1::-1].lstrip("0")

(left, right) = (int(tok) for tok in input().split())
print(len([i for i in range(left, right + 1) if is_palindrome(i)]))

Submission status: Accepted

Solution code:
import sys
from statistics import *
from collections import *
from operator import itemgetter
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a, b = na()
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())
count=0
for i in range(a,b+1):
    m = list(str(i))
    if m[0]==m[4]:
        if m[1]==m[3]:
            count+=1
print(count)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=a
ans=0
while b>=c:
    d=str(c)
    if int(d[0])==int(d[4]) and int(d[1])==int(d[3]):
        ans+=1
    c+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(a,b+1):
  I = list(str(i))
  q=I[0]
  w=I[1]
  e=I[2]
  r=I[3]
  t=I[4]
  y = t+r+e+w+q
  if int(y) == i:
    c += 1
    
print(c)

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[-1] and s[1]==s[-2]: 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())
r = 0
for i in range(A, B+1):
  if i//10000%10 == i%10 and i//1000%10 == i//10%10:
    r += 1
print(r)

Submission status: Accepted

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

count=0

for i in range(a,b+1):
  mae=[]
  usi=[]
  for j in range(len(str(i))):
    mae.append(str(i)[j])
  for j in range(int(len(str(i))-1),-1,-1):
    usi.append(str(i)[j])
  if mae==usi:
    count+=1

print(count)

Submission status: Accepted

Solution code:
l, h = map(int, input().split())
print(sum(1 if str(x) == str(x)[::-1] else 0 for x in range(l, h+1)))

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):
    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):
    n0 = str(i)
    n1 = ""
    for j in range(len(n0)):
        n1 = n0[j] + n1
    if n0 == n1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
c=0
for i in range(a,b+1):
  d=str(i)
  if d[0]==d[-1] and d[-2]==d[1]:
    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):
    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 == int(''.join(list(reversed(str(i))))):
        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):
    j = list(str(i))
    if j[0] == j[4] and j[1] == j[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:
# -*- coding: utf-8 -*-

def reverse(text):
    tmp = list(text)
    tmp.reverse()
    return "".join(tmp)
    
a, b = map(int, input().split())

count = 0
for i in range(a, b + 1):
    text = str(i)
    reversed = reverse(text)
    # print("{} / {}".format(text, reversed))
    if text == reversed:
        count += 1

print(count)

Submission status: Accepted

Solution code:
def test():
    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)


if __name__ == "__main__":
    test()

Submission status: Accepted

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


if __name__ == "__main__":
    test()

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:
def resolve():
    a, b = map(int, input().split())
    ans = 0
    for d1 in range(1, 10):
        for d2 in range(10):
            for d3 in range(10):
                d = d1 * 10000 + d2 * 1000 + d3 * 100 + d2 * 10 + d1
                if a <= d <= b:
                    ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import sys
A, B = map(int, sys.stdin.readline().rstrip().split())
cnt = 0
for i in range(A, B+1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-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[0] == s[4] and s[1] == s[3]:
        ans = 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[::]==s[::-1]:
        count+=1
print(count)

Submission status: Accepted

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

result = 0

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = 0
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())
nums = []
for i in range(A,B+1):
  str_i = str(i)
  if all(str_i[x] == str_i[-x-1] for x in range(int(len(str_i)/2))):
    nums.append(int(str_i))

print(len(nums))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
L = list(range(A, B + 1))
count = 0

for i in L:
    tmp = list(str(i))
    if tmp[0] == tmp[4] and tmp[1] == tmp[3]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a, b = map(int,input().split())

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

Submission status: Accepted

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

def check(x):
    s = str(x)
    s_size = len(s)
    for pos in range(s_size // 2 + 1):
        if s[pos] != s[s_size - 1 - pos]:
            return False
    return True

ans = 0
for x in range(A, B+1):
    if check(x):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a, b = [int(_) for _ in input().split()]

print(sum([int(str(i) == str(i)[::-1]) for i in range(a, b + 1)]))

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

print(cnt)