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 = [int(s) for s in input().split()]
c = int(str(a)[:3])
d = int(str(b)[:3])
count = 0
for x in range(c, d + 1):
    x = str(x)
    y = int(x + x[1] + x[0])
    if a <= y <= b:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
start, end = map(int, input().split())
num = len([i for i in range(start, end+1) if list(str(i)) == list(str(i))[::-1]])
print(num)

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

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:
A,B = map(int,input().split())
count = 0
for i in range(A,B + 1):
    if str(i)[0] == str(i)[1] == str(i)[-1] == str(i)[-2] :
        count += 1
    elif str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# your code goes here
A,B = map(int,input().split())

ans = 0
for i in range(A,B+1):
	if i//10000 == i%10 and (i%10000)//1000 == (i%100)//10:
		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 = list(map(int, input().split()))

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

print(count)

Submission status: Accepted

Solution code:
X = list(int(i) for i in input().split())
cnt = 0

for i in range(X[0], X[1]+1):
    a = int(i / 10000 % 10)
    b = int(i / 1000 % 10)
    c = int(i / 100 % 10)
    d = int(i / 10 % 10)
    e = int(i % 10)
    if a == e and b == d:
        cnt += 1

print("%d" % cnt)

Submission status: Accepted

Solution code:
ab = input().split()

a = int(ab[0])
b = int(ab[1])
num = 0

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    A, B = [int(x) for x in stdin.readline().rstrip().split()]
    print(len([x for x in range(A, B + 1) if str(x) == str(x)[::-1]]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math as m
C = input().split()
A = int(C[0])
B = int(C[1])

count = 0
for i in range(A, B+1):
    i2 = i
    change = 0
    keta = int(m.log(i, 10))
    for j in range(keta, -1, -1):
        change += int(i2/(10**j))*(10**(keta-j))
        i2 -= int(i2/(10**j))*(10**j)
    #print(change)
    if i == change:
        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)
  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):
    ls = list(str(i))
    if ls == ls[::-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):
    n = str(i)
    if n[0] == n[4] and n[1] == n[3]:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
for N in range(A,B+1):
    N_list = list(str(N))
    N_list_inv = N_list[::-1]
    if N_list == N_list_inv:
        counter += 1
print(counter)

Submission status: Accepted

Solution code:
import math
import sys
from collections import Counter
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])

#print(a,b)

arr_list=[]
for i in range(1,10):
    
    for j in range(0,10):
        
            for k in range(0,10):
                
                arr_list.append(int(str(i)+str(j)+str(k)+str(j)+str(i)))
                
                
arr2 = list(filter(lambda x : x >= a and x<=b, arr_list))

print(len(arr2))

Submission status: Accepted

Solution code:
A, B = map(int, raw_input().split())
print len(filter(lambda x: str(x) == str(x)[::-1], range(A, B+1)))

Submission status: Accepted

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

num = value[0]
count = 0

while num <= value[1]:
  if num // 10000 == num % 10 and num // 1000 % 10 == num % 100 // 10:
    count += 1
  num += 1
  
print(count)

Submission status: Accepted

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

count = 0
for i in range(int(a), int(b)+1):
    flag = 1
    #print(i)
    for j in range(int(len(str(i))/2)):
        #print("{} vs {}".format(str(i)[j], str(i)[-j-1]))
        if str(i)[j]!=str(i)[-j-1]:
            flag = 0
            break
    if flag==1:
        count +=1
print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
[A, B] = [int(i) for i in 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:
if __name__ == '__main__':
    A, B = raw_input().split()
    c = 0
    while int(A) <= int(B):
        if A[0] == A[4] and A[1] == A[3]:
            c += 1
        A = str(int(A)+1)
    print c

Submission status: Accepted

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

a, b = map(int, input().split())
count = 0
for v in range(a, b+1):
    t = str(v)
    n = len(t)
    if all([t[i] == t[n-i-1] for i in range(int(n/2))]):
        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[4] and tmp[1] == tmp[3]:
        cnt += 1
print(cnt)

Submission status: Accepted

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

a, b = [int(x) for x in input().split()]
flag, count = 0, 0
for i in range(a,b+1):
    flag = 0
    si = str(i)
    for j in range(int(len(si)/2)):
        if si[j] == si[-(j+1)]:
            pass
        else:
            flag = 1
    if flag == 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
import io


def run(input: io.TextIOBase, output: io.TextIOBase):
    l = input.readline().split()
    a = int(l[0])
    b = int(l[1])

    count = 0

    def is_anagram(x: int):
        x_str = str(x)
        for i in range(0, len(x_str)//2):
            if x_str[i] != x_str[-i-1]:
                return False
        return True

    for x in range(a, b + 1):
        if is_anagram(x):
            count += 1
    output.write(str(count) + '\n')


if __name__ == '__main__':
    run(sys.stdin, sys.stdout)

Submission status: Accepted

Solution code:
def isPlindrome(i):
    return str(i) == str(i)[::-1]


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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = input().split()
r = int(b[0:3])-int(a[0:3])+1
if int(a[3:5]) > int(a[0:2][::-1]):
  r -= 1
if int(b[3:5]) < int(b[0:2][::-1]):
  r -= 1
print(r)

Submission status: Accepted

Solution code:
import math
import numpy as np
from operator import mul

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

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

Submission status: Accepted

Solution code:
def is_palindromic(n):
    if str(n) == str(n)[::-1]:
        return True
    else:
        return False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
	a,b=map(int,input().split())
	ans=0
	for i in range(a,b+1):
		if kaibun(i):
			ans+=1
	print(ans)

if __name__=="__main__":
	main()

Submission status: Accepted

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

for i in range(a, b+1):
  ok = True
  c = str(i)
  for j in range(int(len(c) / 2)):
    if c[j] != c[-j-1]:                                                                                                    
      ok = False
      break
  if ok:
    result += 1

print(result)

Submission status: Accepted

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

count = 0
for i in range(a, b + 1):
    s = i // 10000
    t = (i % 10000) // 1000
    u = (i % 100) //  10
    v = i % 10
    if s == v and t == u:
        count += 1
print(count)

Submission status: Accepted

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

count = 0
for i in range(a, b + 1):
    listed_i = list(str(i))
    if listed_i[0] == listed_i[4] and listed_i[1] == listed_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):
    j = str(i)
    k = int(j[::-1])
    if i == k:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def is_palindrome(sn):
    return sn[0] == sn[4] and sn[1] == sn[3]

a, b = map(int, input().split())
res = 0
for n in range(a, b + 1):
    sn = "%5d" % n
    if is_palindrome(sn):
        res += 1

print(res)

Submission status: Accepted

Solution code:
l = input().split()
A = int(l[0])
B = int(l[1])

cnt = 0
for i in range(A, B + 1):
	S = str(i)
	ok = True
	for j in range(0, 3):
		if S[j] != S[4 - j]:
			ok = False
			break

	if ok:
		cnt = cnt + 1

print(cnt)

Submission status: Accepted

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

while a<=b:
    c=str(a)
    if c[0]==c[4]:
        if c[1]==c[3]:
            k+=1
    a+=1
    
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

rot_num = 0

for i in range(a, b+1):
    i_str = str(i)

    if i_str == i_str[::-1]:
        rot_num += 1

print(rot_num)

Submission status: Accepted

Solution code:
import math

a=input().rstrip().split(" ")

sum=0
for i in range( int(a[0]) , int( a[1] ) + 1 ,1  ):
    if(math.floor(i/10000) == i%10 and math.floor(i/1000)%10 == math.floor(i%100/10)):
        sum=sum+1

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -- coding: utf-8 --
a, b = map(int, input().split(' '))
count = 0
for first in range(10):
    for second in range(10):
        for third in range(10):
            loop_num = first * 10001 + second * 1010 + third * 100
            if a <= loop_num <= b:
                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==i[::-1]:
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(n)

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)
    pv = len(s)//2
    rs = s[::-1]
    if not(len(s)%2==0) and s[:pv]==rs[:pv]:
        ans += 1
    elif len(s)%2==0 and s[:pv]==rs[:pv]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_palindromic(x):
    s = str(x)
    left = 0
    right = len(s) - 1
    while (left < right):
        if (s[left] != s[right]):
            return False
        left += 1
        right -= 1
    return True
    
if __name__ == "__main__":
    A,B = map(int, input().split())
    result = 0
    for x in range(A, B + 1):
        if is_palindromic(x):
            result += 1
    print (result)

Submission status: Accepted

Solution code:
start, end = [int(i) for i in input().split()]

print(len([i for i in range(start, end + 1) if str(i) == str(i)[::-1]]))

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
def to_list(num):
    ret = []
    while num != 0:
        ret.append(num % 10)
        num /= 10
    return ret[::-1]


def is_palindromic(lnum):
    return lnum[0] == lnum[-1] and lnum[1] == lnum[-2]


def increment(lnum):
    if lnum[2] < 9:
        lnum[2] += 1
    elif lnum[1] < 9:
        lnum[1] += 1
        lnum[-2] += 1
        lnum[2] = 0
    else:
        lnum[0] += 1
        lnum[-1] += 1
        lnum[1] = 0
        lnum[-2] = 0
        lnum[2] = 0
    return lnum


def find_first(lnum):
    orig = lnum[::]
    lnum[-1] = lnum[0]
    lnum[-2] = lnum[1]

    while lnum < orig:
        lnum = increment(lnum)

    return lnum


def solve(low, high):
    llow, lhigh = map(to_list, (low, high))
    if not is_palindromic(llow):
        llow = find_first(llow)


    total = 0
    while llow <= lhigh:
        total += 1
        llow = increment(llow)

    return total


def main():
    low, high = map(int, raw_input().strip().split())
    print solve(low, high)


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
c = b // 100 - a // 100
d = (a // 1000) % 10
e = a // 10000
f = a % 100
g = b % 100
h = (b // 1000) % 10
i = b // 10000
if 10 * d + e < f and (10 * h + i) <= g :
	print(c)
elif 10 * d + e < f and not 10 * h + i <= g :
	print(c - 1)
elif not 10 * d + e < f and 10 * h + i <= g :
	print(c + 1)
else:
	print(c)

Submission status: Accepted

Solution code:
def main():
    #1. input
    a, b = map(int, input().split())

    ans = 0

    #2. from A to B
    for i in range(a, b+1):
        #2.1. judge if the number is palindromic
        if (str(i)[0]==str(i)[4]) and (str(i)[1]==str(i)[3]):
            ans = ans+1

    #3. output
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


import math


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

result = 0

for i in range(A, B + 1):
    string    = str(i)
    list_flag = [string[j] == string[-j - 1] for j in range(math.ceil(len(string) / 2))]
    if (len(list_flag) == sum(list_flag)):
        result += 1

print(result)

Submission status: Accepted

Solution code:
import numpy as np

n, m = list(map(int, input().split()))
a = 0

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

print(a)

Submission status: Accepted

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

ans = 0
for x in range(A, B + 1):
    s = str(x)
    if s == "".join(reversed(list(s))):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input("")
data = data.split(" ")
sum = 0

for i in range(int(data[0]), int(data[1])+1):
    if str(i) == str(i)[::-1]:
            sum += 1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#abc090b

a,b=map(int,raw_input().split())
cnt=0
for i in xrange(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())
counter = 0
for i in range(a,b+1):
    s = str(i)
    if s[0] == s[4] and s[1] == s[3]:
        counter = counter + 1
print(counter)

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
start, end = map(int, input().split())

count=0
value = start
while value <= end:
  if value // 10000 == value % 10 and value // 1000 % 10 == value % 100 // 10:
    count += 1
  value += 1

print( count )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
T=(input()).split(' ')
A=T[0]
C=T[1]
result=0

for i in range(0,(int(C)-int(A)+1)):
    s1=(str(int(A)+i))[0:2]
    s2=((str(int(A)+i))[3:5])[::-1]
    
    if s1==s2:
        result=result+1
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    palindromic_gen = (
        num for num in range(a, b+1)
        if str(num) == str(num)[::-1]
    )
    print(
        sum(1 for _ in palindromic_gen)
    )

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
def main():
    #1. input
    a, b = map(int, input().split())
    
    ans = 0
    
    #2. from A to B
    for i in range(a, b+1):
        #2.1. judge if the number is palindromic
        if (str(i)[0]==str(i)[4]) and (str(i)[1]==str(i)[3]):
            ans = ans+1
        
    #3. output
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

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

for i in range(A, B+1):
    if judge(str(i)):
        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)
    r = s[::-1]
#   print('{0} {1}'.format(s, r))
    if s == r:
        c += 1

print(c)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
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 LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    r = 0
    for i in range(a,b+1):
        s = str(i)
        if s == s[::-1]:
            r += 1

    return r


print(main())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

count = 0

for i in range(a, b + 1):
    work_i = i
    n = 1
    while work_i >= 10:
        n += 1
        work_i = int(work_i / 10)

    flag = True
    for j in range(int(n/2)):
        if int(i / 10**j) % 10 != int(i / 10**(n-j-1)) % 10:
            flag = False

    if flag:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(counts)

Submission status: Accepted

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

def ip(n):
  r = list(str(n))
  r.reverse()
  return r == list(str(n))

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

Submission status: Accepted

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

solve()

Submission status: Accepted

Solution code:
def iscyclic(n):
    l = [int(x) for x in list(str(n))]
    N = len(l)
    if N % 2 == 0:
        return False
    else:
        n = N / 2
        for i in range(0, n):
            a = l[i]
            b = l[N - (i + 1)]
            if a != b:
                return False
        return True


def cyclicnum(a, b):
    res = []
    for i in range(a, b + 1):
        if iscyclic(i):
            res.append(i)
    return res

A, B = map(int, raw_input().split(" "))

print len(cyclicnum(A, B))

Submission status: Accepted

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

def isAnagram(num):
    n = list(str(num))
    r = list(reversed(str(num)))
    t = 0
    for i in range(len(n)):
        t += 0 if n[i] == r[i] else 1
    return 1 if t == 0 else 0

for i in range(A, B+1):
    cnt += isAnagram(i)

print(cnt)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
if __name__ == "__main__":
    a, b = map(int, input().split())
    ans = 0
    for num in range(a, b+1):
        if str(num) == str(num)[::-1]:
            ans += 1
        else:
            pass
    print(ans)

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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)