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:
""" 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.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Palindromic Numbers
import sys

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

def getAns(a, b) :
    cnt = 0
    for x in range(a, b + 1) :
        L = [0] * 5
        wkX = x
        for _ in range(0, 4) :
            L[_] = wkX % 10
            wkX = wkX // 10
        if L[0] == L[4] and L[1] == L[3] :
            cnt += 1
    return cnt

print(getAns(A, B))

Submission status: Wrong Answer

Solution code:
# Palindromic Numbers
import sys

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

def getAns(a, b) :
    cnt = 0
    for x in range(a, b) :
        L = [0] * 5
        wkX = x
        for _ in range(0, 4) :
            L[_] = wkX % 10
            wkX = wkX // 10
        if L[0] == L[4] and L[1] == L[3] :
            cnt += 1
    return cnt

print(getAns(A, B))

Submission status: Wrong Answer

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

res = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            cand = int(''.join([str(i), str(j), str(k), str(j), str(i)]))
            if A <= cand <= B:
                print(cand)
                res += 1

print(res)

Submission status: Wrong Answer

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

cunt = 0
if not 10000 <= A <= B <= 99999:
    print(0)
    sys.exit(0)
for i in range(A,B):
    sita = list(str(i))
    ue = sita[::-1]

    if sita == ue:
        cunt += 1

print(cunt)

Submission status: Wrong Answer

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

cunt = 0
for i in range(A,B):
    sita = list(str(i))
    ue = sita[::-1]

    if sita == ue:
        cunt += 1

print(cunt)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
n=b-a
count=0
for i in range(n):
    t=a+i
    c=t%10#一桁目
    d=(t%100-c)//10#二桁目
    e=(t%1000-t%100)//100
    f=(t%10000-t%1000)//1000
    g=(t%100000-t%10000)//10000
    if(c==g and d==f):
        count+=1
    else:
        continue
print(count)

Submission status: Wrong Answer

Solution code:
A,B=map(int,input().split())
count=0
for i in range(A,B):
  #print(i)
  str_i=str(i)
  for j in range(len(str(i))):
    #print(str_i[j],str_i[-j-1])
    if(str_i[j]!=str_i[-j-1]):
      break
    if(j>(len(str_i)//2+1)):
      #print(i)
      count+=1
print(count)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
a = str(A)
b = str(B)
a_ = int(a[0:3])
b_ = int(b[0:3])
if a[2] == "0" and a[0] == a[1]:
    b_ += 1 

print(b_-a_)

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
a = str(A)
b = str(B)
a_ = int(a[0:3])
b_ = int(b[0:3])
if a[2] == "0":
    b_ += 1 

print(b_-a_)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,k=map(int, input().split())
if n==2 or k==2:
    print(0)
elif n == 1 and k == 1:print(1)
elif n == 1 or k ==1:
    print(max(n,k)-2)
else:print((n-2)*(k-2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
count = 0
k = B-A
for j in range(k):
    a = A+j
    a = str(a)
    a = list(a)
    L = len(a)
    flag = 0
    for i in range(int(L/2)):
        if a[i] == a[-i-1]:
            pass
        else:
            flag = 1
            break
    if flag == 0:
        count+=1
print(count)

Submission status: Wrong Answer

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


def main():
    """Function."""
    a, b = map(int, input().split())

    counter = 0
    for num in range(a, b):
        line = list(str(num))
        if line == line[::-1]:
            counter += 1

    print(counter)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a,b = map(int,raw_input().split())
r=0
s=t=u=v=0
for i in range(b-a):
	s = a+i%10
	t = a+i/ 10000%10
	u = a+i / 10 % 10
	v = a+i /1000% 10
	if s==t and u == v:
		r +=1
print r

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

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

A,B=input().split() 
cnt_print=0;
for i in range(int(A),int(B)):
  if (str(i)[0:2] == str(i)[4:5]+str(i)[3:4]):
    cnt_print=cnt_print+1
    
print(cnt_print)

Submission status: Wrong Answer

Solution code:
def checkPalindrome(a,b):
    count=0
    for i in range(100,999):
        p1=str(i//10)
        p2=str(i%10)
        p3=int(p1+p2+p1[1]+p1[0])
        if b>=p3 and p3>=a:
            count+=1
    return count


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = [int(i) for i in input().split()]
n = 0
for i in range(a, b):
  x = list(str(i))
  y = x.copy()
  y.reverse()
  if y == x:
    n+=1
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
c = 0
for i in range(a, b + 1):
  x = list(str(i))
  y = reversed(x)
  if x == y:
    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) :
    p = i % 100
    q = i // 1000
    if p == q :
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(cnt)

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.find(s[::-1]) == 0:
        ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split()) 
c = 0
for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      x = 10001*i+1010*j+100*k
      if x >= a and x <= b:
        c += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
Keys=list(map(int,input().split()))
Count=0
for i in range(Keys[0],Keys[1]+1):
    N=str(i)
    if N==N[::-1]:
        Count+=1
    if i==Keys[0]:
        print('J')
print(Count)

Submission status: Wrong Answer

Solution code:
Keys=list(map(int,input().split()))
Count=0
for i in range(Keys[0],Keys[1]):
    N=str(i)
    if N==N[::-1]:
        Count+=1

print(Count)

Submission status: Wrong Answer

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

kA = int(A[0:3])*100 + int(A[1:2])*10 + int(A[0:1])
kB = int(B[0:3])*100 + int(B[1:2])*10 + int(B[0:1])

maxB = int(B[0:3]) + int(kB <= int(B))
maxA = int(A[0:3]) + int(kA > int(A))

print(maxB - maxA)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
if N==1 and M==1:
  print(1)
elif N==1:
  print(M-2)
else:
  print((M-2)*(N-2))

Submission status: Wrong Answer

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

print(b//100 - a//100 + bool(a//1000 <= a%100) + bool(b//1000 <= b%100))

Submission status: Wrong Answer

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

res = (int(b)-int(a))//100
"""
if int(a[:2]) > int(a[3:5]):
    res += 1
if int(b[:2]) < int(b[3:5]):
    res += 1
"""

if a[2] == '0':
    res += 1
print(res)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = input().split()
a = int(A)
b = int(B)
ans = 0
for i in range(a,b+1):
    N = str(i)
    if N[0:2] == N[3:5]:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
A,B = input().split()
a = int(A)
b = int(B)
ans = 0
for i in range(a,b):
    N = str(i)
    if N[0:2] == N[3:5]:
        ans += 1
print(ans)

Submission status: Wrong Answer

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

cc = 0
for i in range(A, B+1):
  x = list(str(i))
  if x[0]==x[4] and x[1]==x[2]:
    cc += 1

print(cc)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

count = 0
for i in range(B-A):
    number = A+i
    charnum = str(number)
    if(charnum[0]==charnum[4] and charnum[1]==charnum[3]):
        count = count + 1
  
print(count)

Submission status: Wrong Answer

Solution code:
#!C:\Users\daichi\Anaconda3/python.exe
# -*- coding: utf-8 -*-

C = input().split()
A = int(C[0])
B = int(C[1])
count=0

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

print(count)

Submission status: Wrong Answer

Solution code:
def main6():
    str = input('');

    buf = str.split();
    num = [];
    result = 0;
    for i in range(2):
        num.insert(i,int(buf[i]));
    for i in range(num[1] - num[0] + 1):
        k = num[0] + i;
        k1 = int(k/10000)%10;
        k2 = int(k/1000)%10;
        k4 = int(k/10)%10;
        k5 = k%10;
        if k1 == k5 & k2 == k4:
            result = result + 1;
    print(result);



if __name__ == '__main__':
    #main4()
    #main5()
    main6()

Submission status: Wrong Answer

Solution code:
def main6():
    str = input('');

    buf = str.split();
    num = [];
    result = 0;
    for i in range(2):
        num.insert(i,int(buf[i]));
    for i in range(num[1] - num[0] + 1):
        k = num[0] + i;
        k1 = int(k/10000);
        k2 = int(k/1000)%10;
        k4 = int(k/10)%10;
        k5 = k%10;
        if k1 == k5 & k2 == k4:
            result = result + 1;
    print(result);



if __name__ == '__main__':
    #main4()
    #main5()
    main6()

Submission status: Wrong Answer

Solution code:
N,M= map(int, input().split())
print(abs((N-2)*(M-2)))

Submission status: Wrong Answer

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

for i in range(X[0], X[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: Wrong Answer

Solution code:
A, B= map(int, input().split())
N=B-A
count=0
for i in range (N):
    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: Wrong Answer

Solution code:
def solve():
    A, B = input().split()
    a = int(A)
    b = int(B)
    if a == b:
        print(0)
        return
    a_pre = int(A[:2][::-1])
    a_mid = int(A[2])
    a_post = int(A[-2:])
    # print(a_pre, a_mid, a_post)
    b_pre = int(B[:2][::-1])
    b_mid = int(B[2])
    b_post = int(B[-2:])
    # print(b_pre, b_mid, b_post)
    
    ans = int((b-a)/100) + 1
    if a_pre < a_post:
        ans -= 1
    if b_pre > b_post:
        ans -= 1
    print(ans)
solve()

Submission status: Wrong Answer

Solution code:
def solve():
    A, B = map(int, input().split())
    if A == B:
        if int(str(A)[:2][::-1]) > int(str(A)[-2:]):
            print(1)
        else:
            print(0)
        return
    ans = 0
    if int(str(A)[:2][::-1]) > int(str(A)[-2:]):
        ans += 1
    A += 100

    while int(A/100) < int(B/100):
        ans += 1
        A += 100
    if int(str(B)[:2][::-1]) < int(str(B)[-2:]):
        ans += 1
    print(ans)
solve()

Submission status: Wrong Answer

Solution code:
def solve():
    A, B = map(int, input().split())
    ans = 0
    if int(str(A)[:2][::-1]) > int(str(A)[-2:]):
        ans += 1
    A += 100

    while int(A/100) < int(B/100):
        ans += 1
        A += 100
    if int(str(B)[:2][::-1]) < int(str(B)[-2:]):
        ans += 1
    print(ans)
solve()

Submission status: Wrong Answer

Solution code:
def solve():
    A, B = input().split()
    a = int(A)
    b = int(B)
    a_pre = int(A[:2][::-1])
    a_mid = int(A[2])
    a_post = int(A[-2:])
    b_pre = int(B[:2][::-1])
    b_mid = int(B[2])
    b_post = int(B[-2:])
    
    ans = int((b-a)/100) + 1
    if a_pre < a_post:
        ans -= 1
    if b_pre > b_post:
        ans -= 1
    print(ans)

solve()

Submission status: Wrong Answer

Solution code:
def solve():
    A, B = input().split()
    a = int(A)
    b = int(B)
    a_pre = int(A[:2])
    a_mid = int(A[2])
    a_post = int(A[-2::-1])
    b_pre = int(B[:2])
    b_mid = int(B[2])
    b_post = int(B[-2::-1])
    
    ans = int((b-a)/100) + 1
    if a_pre < a_post:
        ans -= 1
    if b_pre > b_post:
        ans -= 1
    print(ans)

solve()

Submission status: Wrong Answer

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

count = 0
for i in range(int(a), int(b)):
    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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_palindromic(n):
    if str(n) == str(n)[::-1]:
        True
    else:
        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: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

print(N)

Submission status: Wrong Answer

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
if (10 * d + e) < f and (10 * d + e) < g :
	print(c)
elif 10 * d + e < f and not 10 * d + e <= g :
	print(c - 1)
elif not 10 * d + e < f and 10 * d + e <= g :
	print(c + 1)
else:
	print(c)

Submission status: Wrong Answer

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

count = 0

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

print(count)

Submission status: Wrong Answer

Solution code:
#abc090b

a,b=map(int,raw_input().split())
print a,b
cnt=0
for i in xrange(a,b+1):
 s=i%10
 t=i/10000%10
 u=i/10%10
 v=i/1000%10
 if s==t and u==v:
  cnt+=1
print cnt

Submission status: Wrong Answer

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

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

print( count )

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
n = []
n = map(int, raw_input().split(" "))
ans = 0
for i in range(n[0],n[1]):
	if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
		ans += 1
print ans

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(counts)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

palindrome()
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(Ans)

Submission status: Wrong Answer

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

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

Ans = 0
Data = A
while Data <= B:
    A = Data // 10000
    B = Data // 1000
    D = Data // 10
    E = Data % 10
    if (A==E) and (B==D):
        Ans += 1
    
    Data += 1 

print(Ans)

Submission status: Wrong Answer

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

ans = (int(B) - int(A))// 10 ** (len(A)//2)
AU = ""
AL = ""

BU = ""
BL = ""

for i in range(len(A)//2)[::-1]:
    AU += A[i]
    AL += A[-i -1]

for i in range(len(B)//2)[::-1]:
    BU += B[i]
    BL += B[-i -1]
    
ans = int(ans) - int(AU > AL) + int(BU <= BL)

if ans < 0:
    ans = 0

print(ans)

Submission status: Wrong Answer

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

def main():
    a = list(map(int, list(input().split(' '))))
    count = (a[1]//1000 - a[0]//1000 - 1)*10
    count += a[1]//100 % 10 + 1 + 9 - (a[0]//100 % 10)
    if a[0]%100 <= a[0]//10000+((a[0]//1000)% 10)*10:
        count += 1
    if a[1]%100 >= a[0]//10000+((a[1]//1000)% 10)*10: 
        count +=1
    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    a = list(map(int, list(input().split(' '))))
    count = (a[1]//1000 - a[0]//1000 - 1)*10
    count += a[1]//100 % 10 + 1 + 9 - (a[0]//100 % 10)
    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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:
                        z = z + 1
                        break
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count)

Submission status: Wrong Answer

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

def main():
    a = list(map(int, list(input().split(' '))))
    count = (a[1]//1000 - a[0]//1000 - 2)*10
    count += a[1]//100 % 10 + 1 + 9 - (a[0]//100 % 10)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print A
print B

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

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

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

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

print(count)

Submission status: Wrong Answer

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

ans = (int(B) - int(A))// 10 ** (len(A)//2) -1
AU = ""
AL = ""

BU = ""
BL = ""

for i in range(len(A)//2)[::-1]:
    AU += A[i]
    AL += A[-i -1]

for i in range(len(B)//2)[::-1]:
    BU += B[i]
    BL += B[-i -1]
ans = int(ans) + int(AU >= AL) + int(BU <= BL)

if ans < 0:
    ans = 0

print(ans)

Submission status: Wrong Answer

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 AB[0][0:3] != AB[1][0:3]:
    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)

else:
    if A<= int(rA) and int(rB) >= B:
        ans = 1
    
print(ans)

Submission status: Wrong Answer

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
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count-1)

Submission status: Wrong Answer

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
print(rA, rB)

    
if AB[0][0:3] != AB[1][0:3]:
    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)

else:
    if A<= int(rA) and int(rB) >= B:
        ans = 1
    
print(ans)

Submission status: Wrong Answer

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):
    if rep(i):
        count += 1
print(count)

Submission status: Wrong Answer

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
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
    x = x + 1
    y = 0
print(count-1)

Submission status: Wrong Answer

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

ans = (int(B) - int(A))// 10 ** (len(A)//2) -1
AU = ""
AL = ""

BU = ""
BL = ""

for i in range(len(A)//2)[::-1]:
    AU += A[i]
    AL += A[-i -1]

for i in range(len(B)//2)[::-1]:
    BU += B[i]
    BL += B[-i -1]

print(int(ans) + int(AU >= AL) + int(BU <= BL))

Submission status: Wrong Answer

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
                    count = count + 1
                    z = z + 1
        y = y + 1
    x = x + 1
    y = 0
    z = 0
print(count)

Submission status: Wrong Answer

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

A = inp[0]
B = inp[1] + 1
ans = 0
j = 0
k = 0
for i in range(A, B):
  j = len(str(i)) // 2
  rem = len(str(i)) % 2
  if rem == 0: # 偶数桁
    k = j
  else: # 奇数桁
    k = j + 1

  if str(i)[0:j] == str(i)[k:]:
    ans += 1

print (ans)