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:
def check_num(n):
	a=list(n)
	b=list(n)
	a.reverse()
	if a==b:
		return True
	else:
		return False
num=[x for x in input().split()]
A=int(num[0])
B=int(num[1])
cnt=0
for i in range(A,B+1):
	if check_num(str(i)):
		cnt+=1
	else:
		continue
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

palindrome()
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Palindromic Numbers
https://beta.atcoder.jp/contests/abc090/tasks/abc090_b

"""
import sys
from sys import stdin
input = stdin.readline


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


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

if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split());print(len([1 for i in range(a,b+1)if i//1000==i%10*10+i%100//10]))

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

print(ans)

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(s)):
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
 
def kaibun(m, n):
    key = 0
    for i in range(m,n+1):
        s = i//10000  
        t = i%10
        u = i//1000 % 10
        v = i//10 % 10
        if (s==t)&(u==v):
            key += 1
    return key
 
print(kaibun(A,B))

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
Tmp = []
Tmp  = input().rstrip().split(' ')

A = int(Tmp[0])
B = int(Tmp[1])

Ans = 0
Data = A
while Data <= B:
    C = Data // 10000
    D = (Data - C * 10000 )// 1000
    E = Data // 100
    F = (Data - E * 100 )// 10
    G = Data % 10
    if (C==G) and (D==F):
        Ans += 1    
    Data += 1 

print(Ans)

Submission status: Accepted

Solution code:
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == B:
                        count = count + 1
                        break
                    if N < A:
                        count = count -1
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count)

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:
AB = input().split()
A, B = int(AB[0]), int(AB[1])
a, b = 0, 0
rA, rB  = AB[0][:3]+AB[0][1]+AB[0][0], AB[1][:3]+AB[1][1]+AB[1][0]
ans = 0

if A <= int(rA):
    a = 1
if B < int(rB):
    b = 1
ans = (int(str(B)[0:3])-b)-(int(str(A)[0:3])-a)
print(ans)

Submission status: Accepted

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

num=0

for x in range(A,B+1):
 c1=x/10000
 c2=x/1000
 c3=x/100
 c4=x/10
 c5=x
 a1=c1
 a2=c2-c1*10
 a3=c3-c2*10
 a4=c4-c3*10
 a5=c5-c4*10
 if a1==a5 and a2==a4:
  num=num+1

print num

Submission status: Accepted

Solution code:
#coding=utf-8

def check_circle(s):
    x = str(s)
    flag = True
    for i in range(int(len(x) / 2)):
         if x[i] != x[-1 * (i + 1)]:
              flag = False
    return flag

def solve(A, B):
    count = 0
    for y in range(A, B + 1):
        if check_circle(y):
            count += 1

    return count

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

c = int(a[:3])
if int(a[1::-1]) < int(a[3:]):
    c += 1

d = int(b[:3])
if int(b[1::-1]) > int(b[3:]):
    d -= 1

print(d - c + 1)

Submission status: Accepted

Solution code:
def rep(n):
    n=str(n)
    l=len(n)
    for i in range (0,l//2+1):
        if n[i]!=n[l-i-1]:
            return False
    return True

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

  if str(i)[0:1] == str(i)[4:] :
    if str(i)[1:2] == str(i)[3:4] :
      ans += 1

print (ans)

Submission status: Accepted

Solution code:
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
# coding:utf-8

in1 = input().split()

in1 = [int(i) for i in in1]
cnt = 0

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

    if(a==e and b==d):
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

n1, n2 = map(int, input().split())

l1 = [int(x) for x in list(str(n1))]
l2 = [int(x) for x in list(str(n2))]

n1Low = n1%100
n2Low = n2%100

n1HighRev = int(str(l1[1])+str(l1[0]))
n2HighRev = int(str(l2[1])+str(l2[0]))

ans = 0

if n1Low <= n1HighRev:
    ans += 1
if n2Low >= n2HighRev:
    ans += 1

if l1[0] != l2[0]:
    ans += 9 - l1[2] + l2[2]
    ans += (l2[0] - l1[0] - 1) * 100
    ans += (9 - l1[1] + l2[1]) * 10
else:
    if l1[1] != l2[1]:
        ans += 9 - l1[2] + l2[2]
        ans += (l2[1] - l1[1] - 1) * 10
    else:
        ans += l2[2] - l1[2]-1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
STR = input().split()
#STR = int(STR)

IN1 = STR[0]
IN2 = STR[1]
IN1a = int(IN1)
IN2a = int(IN2)
#IN1 = int(IN1)
#IN2 = int(IN2)

#print(IN1s)
length = IN2a - IN1a + 1
#IN1s[0] = 2
#print(IN1s)
#print(STR)
#print(IN1)
#print(length)
out = 0
for i in range(length):
    IN1s = [int(x) for x in list(str(IN1a))]
    IN2s = [int(x) for x in list(str(IN2a))]
    if IN1s[0] == IN1s[4] and IN1s[1] == IN1s[3]:
        IN1a += 1
        out += 1
    else:
        IN1a += 1
        i += 1

print(out)

Submission status: Accepted

Solution code:
#coding:utf-8

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

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

print(ct)

Submission status: Accepted

Solution code:

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

	ans = 0

	for n in range(A,B+1):
		dic = {}
		count = 0
		n = str(n)

		if n[0] == n[4]:
			if n[1] == n[3]:
				ans += 1

	print (ans)

"""			
			if a not in dic.keys():
				dic.update({a:1})
			else:
				val = dic.get(a)
				val += 1
				dic.update({a:val})
				count += 1

		if count ==3:
			ans += 1

		if (len(dic.keys())) == 3 and count ==2:
			ans += 1

		if n == 11111:
			print (count)
"""

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Submission status: Accepted

Solution code:
# coding : utf-8

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


_list = list(range(A, B+1))
count = 0
buff = 0
for elm in _list:
    buff = 0
    m = str(elm)
    _len = len(m) - 1
    for i in range(3):
        if m[i] == m[4-i]:
            buff += 1
    if buff >= 3:
        count += 1



print(count)

Submission status: Accepted

Solution code:
c = int()
li = map(int, raw_input().split(" "))
for i in range(li[0],li[1]+1):
    c = c+1 if str(i) == str(i)[::-1] else c
print c

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[:2] == i[::-1][:2] :
    count += 1
print(count)

Submission status: Accepted

Solution code:
a = raw_input()
l = a.split()
A = l[0]
B = l[1]
ans = 0


if int(A) == int(B):
  ans = 1

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
cnt=0
for i in range(a,b+1):
    i_lst=[]
    i_lst.append(str(i%10))
    i_lst.append(str(int((i%100)/10)))
    i_lst.append(str(int((i%1000)/100)))
    i_lst.append(str(int((i%10000)/1000)))
    i_lst.append(str(int((i%100000)/10000)))
    i_rvs=list(i_lst)
    i_lst.reverse()
#    print(i_lst, i_rvs)
    if(i_lst==i_rvs):
        cnt+=1
print(cnt)

Submission status: Accepted

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

kaibun_cnt = 0
while A <= B:
    num_to_str = str(A)
    if (num_to_str[0] == num_to_str[4]) and (num_to_str[1] == num_to_str[3]):
        kaibun_cnt += 1
    A += 1

print(kaibun_cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_palindrome(num):
    return str(num) == str(num)[::-1]

a, b = map(lambda x: int(x) , input().split())
count = 0
for i in range(a, b + 1):
    if is_palindrome(i):
        count += 1
print(count)

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[0] == num_str[4]:
        if num_str[1] == num_str[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):
    a = str(i)
    if a[0::] == a[::-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):
    t = str(i)
    if t == t[::-1]:
        c += 1
print(c)

Submission status: Accepted

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

a,b = input().split()
A = int(a)
B = int(b)

def judge(n):
    J = 0
    s = str(n)
    if s == s[::-1]:
        J = 1
    else:
        pass
    return J

num = 0
for i in range(A,B+1):
    j = 0
    j = judge(i)
    if j == 1:
        num += 1
    else:
        pass

print(num)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
count =0
for i in range(A,B+1):
    a1 = i - (i // 10) * 10
    a5 = i // 10000
    a2 = ((i - ((i // 100) * 100)) - a1) // 10
    a4 = i // 1000 - (i // 10000) * 10
    if a1 == a5 and a2 == a4:
        count += 1
print(count)

Submission status: Accepted

Solution code:
A = input().split(" ")

B = int(A[0])
C = int(A[1])
Blis = list(A[0])
Clis = list(A[1])
# print(B)
# print(C)
# print(Blis)
# print(Clis)

NUM = B
kazu = 0
while NUM <= C:
    NUMlis = list(str(NUM))
    if NUMlis[0] == NUMlis[4] and NUMlis[1] == NUMlis[3]:
        kazu += 1
    NUM += 1
print(kazu)

Submission status: Accepted

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

a = int(l[0])
b = int(l[1])
palindrome = 0
for num in range(a,b+1):

    num = str(num)
    cnt = 0

    for i in range(2):
        if num[i] == num[4-i]:
            cnt += 1
    if cnt == 2:
        palindrome += 1

print(palindrome)

Submission status: Accepted

Solution code:
def palindrome(string): return 1 if string==string[::-1] else 0

A = map(int,raw_input().split())
count = 0
for i in range(A[0],A[1]+1):
    if(palindrome(str(i))):
        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 = map(int, input().split())
ans = 0
for i in range(A, B+1):
    List_p = list(str(i))
    List_m = list(reversed(List_p))

    if List_p == List_m:
        ans += 1

print(ans)

Submission status: Accepted

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


print(p)

Submission status: Accepted

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


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:
counter = 0
c = list(map(int, input().split(' ')))
for i in range(c[0], c[1] + 1):
  if str(i)[0] != str(i)[4]:
    continue
  if str(i)[1] != str(i)[3]:
    continue
  counter += 1

print(counter)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a = map(int, raw_input().split())
b = a[0]
c = []
while b <= a[1]:
    one = str(b)
    two = str(one[4])+str(one[3])+str(one[2])+str(one[1])+str(one[0])
    if one == two:
        c.append(one)
    b += 1
print len(c)

Submission status: Accepted

Solution code:
a = input()
a = a.split(' ')
A = eval(a[0])
B = eval(a[1])
k = 0
for i in range(A, B + 1, 1):
    l = str(i)
    ok = False
    for j in range(len(l) // 2):
        if l[j] != l[len(l) - 1 - j]:
            ok = True
            break
    if not ok:
        k = k + 1
print(k)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cand = [i*(10**4) + j*(10**3) + k*(10**2) + j*10 + i for i in range(1, 10) for j in range(0, 10) for k in range(0, 10)]

count = 0
for c in cand:
    if c >= A and c <= B:
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    A, B = list(map(int, (input().split(' '))))
    cnt = 0
    for i in range(A, B+1):
        buf = str(i)
        if buf[0] == buf[4] and buf[1] == buf[3]:
            cnt += 1
    print(cnt)

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

c = 0
for i in range(A,B+1):
	c += (i % 10 == (i - i % 10000)/10000)*(((i % 10000)-(i%1000))/1000 == (i%100 - i % 10)/10)

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_line = list(map(int,input().split()))
A = input_line[0]
B = input_line[1]
i = A
out = 0
test = []
while i <= B:
    key = 0
    target = list(str(i))
    if len(target)%2 == 0:
        for j in range(int(len(target)/2)):
            if not(target[j] == target[-(j+1)]):
                key +=1
    else:
        for j in range(int(len(target)/2)):
            if not(target[j] == target[-(j+1)]):
                key +=1

    if key < 1:
        out+=1
    i+=1

print(out)

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    A, B = list(map(int, list(map(float, input().split()))))
    ans = 0
    for i in range(A, B+1):
        c = str(i)
        length = len(c)
        if length%2 == 0:
            continue
        for j in range(length):
            if c[j] == c[length-1-j]:
                if j == length-1-j:
                    ans += 1
                    break
                continue
            else:
                break
    print(ans)

Submission status: Accepted

Solution code:
def kaibun(x):
    x_str = str(x)
    x_str_reverse = x_str[::-1]
    if(x_str == x_str_reverse):
        return True
    else:
        return False

def main():
    ans  = 0
    A,B = list(map(int,input().split()))
    for i in range(A,B+1):
        if kaibun(i):
            ans = ans + 1
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    A, B = [int(v) for v in input().split()]

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

    print(n)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

count = 0
for i in range(10):
    for j in range(10):
        for k in range(1, 10):
            num = i * 100 + j * 1010 + k * 10001
            if num >= a and num <= b:
                count += 1

print(count)

Submission status: Accepted

Solution code:
a, b = list(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:
ab = input().split()
a = int(ab[0])
b = int(ab[1])
cnt = a
ans = 0

while cnt <= b:
    a_str = str(cnt)
    if a_str[0] == a_str[4] and a_str[1] == a_str[3]:
        ans += 1
    cnt += 1

print(ans)

Submission status: Accepted

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

A, B = map(int, input().split(" "))
c = 0
for i in range(A, B + 1):
    num = str(i)
    for j in range(len(num) // 2):
        if num[j] != num[-1 - j]:
            break
        if j == (len(num) // 2 - 1):
            c += 1

print(c)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
m = 0
for i in range(A, B+1):
    num = str(i)
    rev_num = num[4]+num[3]+num[2]+num[1]+num[0]
    if num == rev_num:
        m += 1

print(m)

Submission status: Accepted

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

Submission status: Accepted

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

N = 0
sum = 0

for N in range(A,B+1):
	tmp1 = str(N)
	tmp1 = tmp1[::-1]
	tmp2 = str(N)
	if tmp1 == tmp2:
		sum += 1

print(sum)

Submission status: Accepted

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

count=int(0)

for i in range(b-a+1):
    if str(a+i)[0]==str(a+i)[1] and str(a+i)[1]==str(a+i)[3] and str(a+i)[3]==str(a+i)[4]:
        count+=1
    elif str(a+i)[0]==str(a+i)[4] and str(a+i)[1]==str(a+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):
    tmp = str(i)
    for j in range(len(tmp)):
        if tmp[j] != tmp[len(tmp)-j-1]:
            break
    if j == len(tmp)-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,1):
    l = list(str(i))
    if l[0] == l[4] and l[1] == l[3]:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ri = lambda: int(input())
ria = lambda: list(map(int, input().split()))

A,B = ria()
l = []
for i in range(A, B+1):
    s = str(i)
    if s == s[::-1]:
        l.append(i)
print(len(l))

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 = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
def is_palindrome(n):
    n = str(n)
    return n[0:len(n)//2+1]==n[::-1][0:len(n)//2+1]

if __name__ == '__main__':
    a,b = list(map(lambda x: int(x), input().split(" ")))
    
    c = 0
    for i in range(a,b+1):
        if is_palindrome(i):
            c += 1
    
    print(c)

Submission status: Accepted

Solution code:
# coding=utf-8

line = input().split(" ")
a = int(line[0])
b = int(line[1])

def judge(n):
    n = str(n)
    return n == (n[::-1])

ret = 0
for n in range(a,b+1):
    if judge(n):
        ret += 1

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge(string):
    start = 0
    end = len(string) // 2

    flag = True
    for i in range(start, end):
        if string[i] != string[len(string)-i-1]:
            flag = False
            break
    return flag
    

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

    count = 0
    for n in range(a, b+1):
        string = str(n)
        if judge(string):
            count += 1
    print(count)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

a,b = na()
count = 0
for i in range(a,b+1):
    i = str(i)
    if i[0]==i[1]==i[3]==i[4]:
        count += 1
    elif i[0]==i[4] and i[1]==i[2]==i[3]:
        count += 1
    elif i[0]==i[4] and i[1]==i[3]:
        count += 1
    else:
        pass
print(count)

Submission status: Accepted

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

res = 0
for n in range(a, b + 1):
    s = '{0}'.format(n)
    if s[0] == s[-1] and s[1] == s[-2]:
        res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n):
  a=str(n)
  b=len(a)
  for i in range(b//2):
    if a[i]!=a[b-1-i]:
      return False
  return True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def palindrome(string):

	for i in range(2):
		if string[i] != string[5-i-1]:
			return False;
	return True; 


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


count = 0;

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

	if palindrome(str(i)):
		count += 1;

print (count);

Submission status: Accepted

Solution code:
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 = input().split(' ')
num = 0
for i in range(int(A), int(B)+1):
    s = str(i)
    for j in range(len(s)//2):
        if s[j] != s[len(s)-1-j]:
            break
        if j == len(s)//2 - 1:
            num += 1
print(num)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

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

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    A, B = list(map(str, input().split()))

    count = 0

    for i in range(int(A), int(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())
num = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            c = 10000 * i + 1000 * j + k * 100 + 10 * j + i
            if a <= c <= b:
                num += 1

print(num)

Submission status: Accepted

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

ans=0

for i in range(x[0],x[1]+1):
    if str(i)[0]==str(i)[4]:
        if str(i)[1]==str(i)[3]:
            ans=ans+1

print(ans)    

quit()

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
a,b = map(int,raw_input().split(" "))
ans = 0
for x in range(a,b+1):
  q = str(x)
  if q[0:2] == q[3:5][::-1]:
    ans += 1
print ans

Submission status: Accepted

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

Submission status: Accepted

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


def kaibun(m, n):
	key = 0
	for i in range(m,n+1):
		if str(i) == str(i)[::-1]:
			key += 1
	return key

print(kaibun(A,B))

Submission status: Accepted

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

lst = []
for i in range(1, 10):
    for j in range(10):
        for k in range(10):        
            lst.append(int(str(i)+str(j)+str(k)+str(j)+str(i)))

cnt = 0
for x in lst:
    if a <= x and x <= b:
        cnt += 1
        
print(cnt)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def check(s):
    return (s[0] == s[4] and s[1] == s[3])

A, B = list(map(int, input().split()))
cnt = 0
for i in range(A, B+1):
    if(check(str(i))):
        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().split())
z = 0
for i in range(a,b+1):
    x = list(str(i))
    x = reversed(x)
    y = "".join(x)
    if int(y) == i:
        z += 1
print(z)

Submission status: Accepted

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