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: Wrong Answer

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


def kaibun(x):

    half = len(x) // 2
    if len(x) % 2 == 1:
        front = x[:half]
        back = x[half+1:]

    else:
        front = x[:half]
        back = x[half:]

    if front == back:
        return True

    else:
        return False


for i in range(A, B+1):
    list_i = list(str(i))
    func = kaibun(list_i)

    if func:
        ans += 1

print(ans)

Submission status: Wrong Answer

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


def kaibun(x):
    half = len(x) // 2
    front = x[:half]
    back = x[half+1:]

    if front == back:
        return True

    else:
        return False


for i in range(A, B+1):
    list_i = list(str(i))
    func = kaibun(list_i)

    if func:
        ans += 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# output
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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):
	if str(i)==str(i)[::-1]:
		cnt+=1

print(cnt)

Submission status: Wrong Answer

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

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = input().split()
c = 0
while a <= b:
    if a == a[::-1]:
        c +=1
    a = str(int(a)+1)

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

result = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = input().strip().split(" ")
a_= int(a)
b_= int(b)
c = (b_ - a_)//100

a__ = int(a[1] + a[0]) < int(a[3:5])
b__ = int(b[1] + b[0]) < int(b[3:5])

print(c + a__ + b__)

Submission status: Wrong Answer

Solution code:
a,b = input().strip().split(" ")
a_= int(a)
b_=int(b)
c = (b_ - a_)//100
 
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
cnt = 0
for i in range(A,B):
    l = []
    while i > 0:
        l.append(i%10)
        i//=10
    if l==l[::-1]:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    print(cnt)
    
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
Atop = int(A[:2])
Btop = int(B[:2])
Amiddle = int(A[2])
Bmiddle = int(B[2])
for j in range(Atop,Btop+1):
  for i in range(10):
    temp = j*1000 + i*100 + (j%10)*10 +(j//10)
    if temp > int(A) and temp < int(B):
      count += 1

print(count)

Submission status: Wrong Answer

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

counter = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A = A_B[0]
B = A_B[1]

p_number = 0

for num in range(A, B + 1):
    num_list = [int(x) for x in list(str(num))]
    half = int(len(num_list) / 2)
    end = len(num_list)
    judge = 0
    for j in range(half):
        if num_list[j] == num_list[end - j - 1]:
            continue
        else:
            judge += 1

    if judge == 0:
        print(num_list)
        p_number += 1

print(p_number)

Submission status: Wrong Answer

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

A = A_B[0]
B = A_B[1]

p_number = 0

for num in range(A, B):
    num_list = [int(x) for x in list(str(num))]
    half = int(len(num_list) / 2)
    end = len(num_list)
    judge = 0
    for j in range(half):
        if num_list[j] == num_list[end - j - 1]:
            continue
        else:
            judge += 1

    if judge == 0:
        p_number += 1

print(p_number)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a1 = a//100
b1 = b//100
a2 = a//1000
b2 = b//1000
a3 = ((a2)%10)*10 + (a2%100)//10
b3 = ((b2)%10)*10 + (b2%100)//10
a4 = a%100
b4 = b%100
count = 0
if a3 >= a4:
    count = count + 1
if b3 <= b4:
    count = count + 1
if b1 - a1 == 0:
    if count == 2:
        print(1)
    else:
        print(0)
else:
    print(b1-a1+count)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
a1 = a//100
b1 = b//100
a2 = a//1000
b2 = b//1000
a3 = ((a%100)%10)*10 + (a%100)//10
b3 = ((b%100)%10)*10 + (b%100)//10
count = 0
if a3 <= a2:
    count = count + 1
if b3 >= b2:
    count = count + 1
if b1 - a1 == 0:
    if count == 2:
        print(1)
    else:
        print(0)
else:
    print(b1-a1+count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def read_h(typ=int):
    return map(typ, input().split())


def read_v(n, typ=int):
    return [typ(input()) for _ in range(n)]


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

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

cnt=0
for num in range(a,b+1):
    if int(str(num)[0:2])==int(str(num)[3:5]):
        cnt+=1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(sum(s==s[::-1]for s in map(str,range(*map(int,input().split())))))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import time
import re
import math
import fractions

def main():
    A,B=map(int,input().split())
    count=0
    for a in range(A,B+1):
        s=str(a)
        r=reversed(s)
        if s==r:
            count+=1
    print(count)
    
    
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#"YNeos"[True::2]
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())
# global n,A,s,memo,mx,mn,L,B

Submission status: Wrong Answer

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

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

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

    print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

P = [0] * (B + 1)
for i in range(10000,B + 1):
  if (i // 10000 == i % 10) and ((i // 1000) % 10 == (i // 10) % 10):
    P[i - 9999] = P[i - 10000] + 1
  else:
    P[i - 9999] = P[i - 10000]
print(P[B - 9999] - P[A - 9999])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def inverse(n):
    k = 10 ** (len(str(n)) - 1)
    n_in = 0
    for i in range(len(str(n))):
        n_in += (n % 10) * k
        n = int(n / 10)
        k = k / 10
    return n_in

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

Submission status: Wrong Answer

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

print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

j=0

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

print(j)

Submission status: Wrong Answer

Solution code:
a, b =map(str, input().split())  #複数数値入力
count = 0
c = []
if int(a[3:5]) < int(a[1]+a[0]):
    count += 1

count += int(b[0:3]) - int(a[0:3])

print(count)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
A = i[0]
B = i[1]

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

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

flg = 0

for i in ls:
    if (ls[0]==ls[4]) and (ls[1]==ls[3]):
        flg += 1
        
print(flg)

Submission status: Wrong Answer

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

flg = 0

for i in ls:
    if (ls[0]==ls[4]) and (ls[1]==ls[3]):
        flg += 1
        
print(flg)

Submission status: Wrong Answer

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

count = 0
for i in range(A, B+1):
    if i//1000 == i %100:
        count += 1 

print (count)

Submission status: Wrong Answer

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

a = (B-A)//100

if a < 10:
    a += 1
elif a < 100:
    a += 1

print (a)

Submission status: Wrong Answer

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

print ((B-A)//100)

Submission status: Wrong Answer

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: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
ans=0
for i in range(A,B+1):
    if str(i)[:2] == str(i)[-2:]:
        ans+=1
print(ans)

Submission status: Wrong Answer

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

n=b-a

k=0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
nyu=input()
nyu=nyu.split()
A=int(nyu[0])
B=int(nyu[1])
count=0
ans=[]
for i in range(A,B+1):
  io=i
  digit=0
  list=[]
  flag=True
  while i!=0:
    list.append(i%10)
    i=int(i/10)
    digit+=1
  for j in range(int(digit/2)):
    if list[j]!=list[digit-1]:
        flag=False
  if flag :
      count+=1
print(count)

Submission status: Wrong Answer

Solution code:
nyu=input()
nyu=nyu.split()
A=int(nyu[0])
B=int(nyu[1])
count=0
ans=[]
for i in range(A,B+1):
  io=i
  digit=0
  list=[]
  flag=True
  while i!=0:
    list.append(i%10)
    i=int(i/10)
    digit+=1
  for j in range(int(digit/2)):
    if list[j]!=list[digit-1]:
        flag=False
  if flag :
      ans.append(io)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
cou = B//100 - A//100
Astr = str(A)
Aup = 10 * int(Astr[1]) + int(Astr[0])
Adown = A % 100
Bstr = str(B)
Bup = 10 * int(Bstr[1]) + int(Bstr[0])
Bdown = B % 100
if Adown > Aup :
    cou -= 1
if Bdown > Bup :
    cou += 1
print(cou)

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
cou = B//100 - A//100 - 1
Astr = str(A)
Aup = 10 * int(Astr[1]) + int(Astr[0])
Adown = A%100
Bstr = str(B)
Bup = 10 * int(Bstr[1]) + int(Bstr[0])
Bdown = B%100
if Adown < Aup :
    cou += 1
if Bdown > Bup :
    cou += 1
print(cou)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect
a, b = [int(item) for item in input().split()]
kbs = [item * 100 + int(str(item)[1])*10 + int(str(item)[0]) for item in range(100,1000)]
print(bisect.bisect(kbs,b) - bisect.bisect(kbs,a))

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
for i in range(a,b+1):
    print(i)
    n = list(str(i))
    n = n[::-1]
    n = int("".join(map(str,n)))
    if n == i:
        count += 1

    n = -1

print(count)

Submission status: Wrong Answer

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

count = 0
for i in range(a,b):
    n = list(str(i))
    n = n[::-1]
    n = int("".join(map(str,n)))
    if n == i:
        count += 1

    n = -1

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    A, B = input().split()
    print(int(B[:3]) - int(A[:3]) + int(int(A[1] + A[0]) >= int(A[3:])))


main()

Submission status: Wrong Answer

Solution code:
def main():
    A, B = input().split()
    print(int(B[:3]) - int(A[:3]))


main()

Submission status: Wrong Answer

Solution code:
A, B = map(int, input().split())
x = range(1,10)
count = 0
for p in x:
    for q in x:
        for r in x:
            sakasama = int(str(p)+str(q)+str(r)+str(q)+str(p))
            if A <= sakasama <= B:
                count += 1
print(count)

Submission status: Wrong Answer

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

ans=b//100-a//100-1

if a//1000-(a-a//100*100)>=0:
    ans+=1
if b//1000-(b-b//100*100)<=0:
    ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
def is_palindrome(a):
    if (a[0] == a[-1]) and (a[1] == a[-2]):
        return True
    return False

ans = 0
a,b = map(int, input().split())
for i in range(a, b+1, 1):
    if (is_palindrome(str(i+a))):
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().strip().split(' '))
a_rev = ""
i = 0
j = 0
cnt = 0

#chk = []

for i in range(b - a):
    a+=1
    
    for j in range(len(str(a))):
        a_rev = a_rev + str(a)[len(str(a)) - 1 - j]   

    if str(a_rev) == str(a):
        cnt+=1
        #chk.append(a_rev)   #test
    else:
        pass
    
    a_rev =""
    
print(cnt)
#print(chk)

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().strip().split(' '))
a_rev = ""
i = 0
j = 0
cnt = 0

chk = []

for i in range(b - a):
    a+=1
    
    for j in range(len(str(a))):
        a_rev = a_rev + str(a)[len(str(a)) - 1 - j]   

    if str(a_rev) == str(a):
        cnt+=1
        chk.append(a_rev)   #test
    else:
        pass
    
    a_rev =""
    
print(cnt)
#print(chk)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if b-a < 1000:
    print((b-a)//100+1)
else:
    print((b-a)//100)

Submission status: Wrong Answer

Solution code:
""" AtCoder """

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

l = []
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            l.append(10000*i + 1000*j + 100*k + 10*j + i)

ans = 0
if A in l:
    ans += 1
if B in l:
    ans += 1

l.append(A)
l.append(B)
l = set(l)
l = list(sorted(l))

ans += l.index(B) - l.index(A) - 1

print(l.index(B) - l.index(A) - 1)

Submission status: Wrong Answer

Solution code:
""" AtCoder """

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

l = []
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            l.append(10000*i + 1000*j + 100*k + 10*j + i)

l.append(A)
l.append(B)
l = set(l)
l = list(sorted(l))

print(l.index(B) - l.index(A) - 1)