Problem:


Score : 200 points

Problem Statement

Find the number of palindromic numbers among the integers between A and B (inclusive).
Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.

Constraints

10000 \leq A \leq B \leq 99999

All input values are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

Print the number of palindromic numbers among the integers between A and B (inclusive).

Sample Input 1

11009 11332

Sample Output 1

4

There are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.

Sample Input 2

31415 92653

Sample Output 2

612



Sample input:
11009 11332


Sample output:
4

Submission status: Accepted

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

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

print(n_satisfied)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  temp = []
  for j in range(5):
    d = 10**(4-j)
    p = i//d
    temp.append(p)
    i -= p*d
  if temp[0] == temp[4] and temp[1] == temp[3]:
    ans += 1
print(ans)

Submission status: Accepted

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

ans = 0

for i in range(A,B+1):
    S = str(i)
    rev = S[::-1]
    if S[:3] == rev[: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):
    c = list(str(i))
    if c[0] == c[4] and c[1]==c[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 = []
    a += str(i)
    if a[0] == a[-1] and a[1] == a[-2]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = 0

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

  if s[0] == s[-1] and s[1] == s[-2]:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
answer = 0
for i in range(a,b+1) :
    j = str(i)
    p1 = j[4]
    p2 = j[3]
    p3 = j[2]
    p4 = j[1]
    p5 = j[0]
    k = int(p1+p2+p3+p4+p5)
    if i == k :
        answer += 1
print(answer)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  x=str(i)
  y=list(x)
  y.reverse()
  z=int(''.join(y))
  if i==z:c+=1
print(c)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
index =a
count =0
while index<b+1:
    charList = list(str(index))
    if charList[0] == charList[4] and charList[1] ==charList[3]:
        count+=1
    index+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

ans = 0

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
'''input
31415 92653
'''
a,b = map(int,raw_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())
cnt = 0
for i in range(a, b+1):
    temp = str(i)
    i = str(i)
    i = i[::-1]
    if i == temp:
        cnt += 1
print(cnt)

Submission status: Accepted

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: Accepted

Solution code:
a, b = map(int, input().split())
counter = 0
for i in range(a, b + 1):
  n = i
  rev = ''
  while n != 0:
    rev += str(n % 10)
    n //= 10
  if rev == str(i):
    counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

print cnt

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
#90b
a,b=map(int,input().split())
c=0
while a<=b:
    temp=str(a)
    a+=1
    if temp[0]==temp[-1] and temp[1]==temp[-2]:
        c+=1
print(c)

Submission status: Accepted

Solution code:
left, right = map(int, input().split())

def isKaibun(num):
    l1 = list(str(num))
    l2 = l1[::-1]
    if l1 == l2:
        return True
    else:
        return False

count = 0
for i in range(left, right+1):
    if isKaibun(i):
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

def isKaibun(num):
    _s = str(num)
    if _s[0] == _s[4] and _s[1] == _s[3]:
        return True
    else:
        return False

for n in range(A, B+1):
    if isKaibun(n):
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#encoding utf-8

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

count = 0
for i in range(a,b+1):
    num = list(str(i))
    kaibun = 0
    for j in range(int(len(num)/2)):
        if num[j] == num[len(num)-j-1]:
            kaibun += 1
    if kaibun == int(len(num)/2):
        count += 1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    A, B = map(int, input().split())
    ans = 0
    for a in range(A, B + 1):
        s = str(a)
        ans += (s == s[::-1])
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
count = 0
for a in range(A//10000,B//10000+1):
    for b in range(10):
        for c in range(10):
            p = a * 10001 + b * 1010 + c * 100
            if p >= A and p <= B:
                count += 1
print(count)

Submission status: Accepted

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



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

print(count)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    a, b = map(int, input().split())
    cnt = 0

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (int(x) for x in raw_input().split())
print len([x for x in xrange(a, b+1) if str(x) == str(x)[::-1]])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
count = 0
for a in range(A // 10000, B // 10000 + 1):
  for b in range(10):
    for c in range(10):
      p = a * 10001 + b * 1010 + c * 100
      if p >= A and p <= B:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

    print(ans)

if __name__ == "__main__":
        main()

Submission status: Accepted

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

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

Submission status: Accepted

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

print(num)

Submission status: Accepted

Solution code:
A,B=map(int, input().split())
cnt=0
for i in range(A,B+1):
    if  i//10000 == i%10 and  i//1000%10 == i//10%10:
        cnt+=1
print(cnt)

Submission status: Accepted

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

A,B = map(int,input().split())
c = 0
for d in range(B-A+1):
  if kaibun(A+d):
    c += 1
print(c)

Submission status: Accepted

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: Accepted

Solution code:
start, end = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
https://abc090.contest.atcoder.jp/tasks/abc090_b
"""
[a,b]=[int(i) for i in input().split()]
c=0
for i in range(a,b+1):
    if str(i)==str(i)[::-1]:
        c=c+1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = (int(_) for _ in input().split(' '))
answer = len([x for x in range(a, b + 1) if (x // 10000 == x % 10 and (x // 1000) % 10 == (x % 100) // 10)])
print(answer)

Submission status: Accepted

Solution code:
def f(k):
    k = str(k)

    for i in range(len(k) // 2):
        if k[i] != k[len(k) - i - 1]:
            return False

    return True

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

    ans = 0
    for k in range(A, B + 1):
        if f(k):
            ans += 1

    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
range_min,range_max = map(int,input().split())
palindromic = 0
for i in range(range_min,range_max+1):
    palindromic += 1 if str(i) == str(i)[::-1] else 0
print(palindromic)

Submission status: Accepted

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

cnt = 0
for i in range(a, b+1):
    i = str(i)
    rev = list(i)
    rev.reverse()
    if i == ''.join(rev):  # 回文数
        cnt += 1
        
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,raw_input().split())
cnt = 0
for x in xrange(a,b+1):
  s = str(x)
  r = s[::-1]
  y = int(r)
  if y == x:
    cnt += 1
print cnt

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans = 0
for x in range(A,B+1):
    s = str(x)
    l = len(s)
    pal = True
    for i in range(l//2 + 1):
        if s[i] != s[l-1-i]:
            pal = False
    if pal:
        ans += 1
print(ans)

Submission status: Accepted

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[3]:
    cc += 1

print(cc)

Submission status: Accepted

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

def iskaibun(n):
    n = str(n)
    if n[0]==n[-1] and n[1] == n[-2]:
        return True
    else:
        return False

result = 0
for i in range(A,B+1):
    result += iskaibun(i)

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for i in range(A, B+1):
    man = i // 10000
    sen = (i % 10000) // 1000
    ten = (((i % 10000) % 1000) % 100) // 10
    one = i % 10
    if man == one and sen == ten:
        cnt += 1

print(cnt)

Submission status: Accepted

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


def is_palindrome(s):
    # 回文判定
    length = len(s)
    for i in range((length + 1) // 2):
        if s[i] != s[length - 1 - i]:
            return False
    return True


cnt = 0
for i in range(a, b + 1):
    if is_palindrome(str(i)):
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 13 17:57:26 2018


A以上B以下の回文数が何個あるか計算する
例) １１２１１

入力
11009 11332

出力
4


@author: Yuya
"""

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

count = 0

for a in range(1, 10):
    for b in range(10):
        for c in range(10):
            N = 10000*a + 1000*b + 100*c + 10*b + a
            if N >= A and N <= B:
                count = count + 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
i = 0
while A <= B:
    if(A//10000 is A%10 and (A%10000)//1000 is (A%100)//10):
        i+=1
    A+=1
print(i)

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

Submission status: Accepted

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

for i in range(A,B+1):
    numberString = str(i)
    numbers.append(numberString)

for number in numbers:
    reverse = number[::-1]
    if number == reverse:
        count += 1

print(count)

Submission status: Accepted

Solution code:

line=input()
line=line.rstrip().split(" ")
line1=int(line[0])
line2=int(line[1])

count=0
for i in range(line1,line2+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())

res = 0

for num in range(A, B + 1):
    if num // 10000 == num % 10 and (num % 10000) // 1000 == (num % 100) // 10:
        res += 1

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x):
    x = str(x)
    if x[0]==x[4] and x[1]==x[3]:
        return True
    else:
        return False
a,b = map(int,input().split())
cnt=0
for i in range(a,b+1):
    cnt += 1 if f(i) else 0
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

A_int = int(A)
B_int = int(B)
count = 0
for a in range(A_int,B_int+1):
	fig = list(str(a))
	if(fig[0]==fig[4] and fig[1]==fig[3]):
		count += 1

print(count)

Submission status: Accepted

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+1):
    kazu = str(i)
   
    if(kazu[0] == kazu[4]):
       if(kazu[1] == kazu[3]):
           count = count + 1

print(count)

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())
count = 0
for i in range(A, B + 1):
    s = str(i)
    if s[0] == s[4] and s[1] == s[3]:
        count += 1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin

a, b = stdin.readline().rstrip().split()
counter = 0

c = int(a)
d = int(b)

for i in range (d - c + 1):
    
    digit_1 = str(i + c)[:1]
    digit_2 = str(i + c)[1:2]
    digit_3 = str(i + c)[3:4]
    digit_4 = str(i + c)[4:5]
  
    if(digit_1 == digit_4 and digit_2 == digit_3):
        counter += 1

print(counter)

Submission status: Accepted

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

count = 0

for i in range(A, B+1):
    num = []
    while i != 0:
        num.append(i%10)
        i = int(i/10)
    
    if num[0] == num[4] and num[1] == num[3]:
        count += 1


print(count)

Submission status: Accepted

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

def main():
    count = 0
    for num in range(A, B + 1):
        s = str(num)
        pri = s[0:3] # first 3 chars
        sec = s[4:1:-1] # last 3 chars
        if pri == sec:
            count += 1
    print(count)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cnt = 0
for n in range(A,B+1):
  n_str = str(n)
  n_len = len(n_str)
  is_kaibun = True
  for i in range(n_len//2):
    if n_str[i] != n_str[n_len-1-i]:
      is_kaibun = False
  if is_kaibun is True:
    cnt += 1
print(cnt)

# if n_str[0] == n_str[4] and n_str[1] == n_str[3]:
#   cnt += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = list(map(int, input('').split()))
count = 0
for x in range(A, B + 1):
  t = str(x)
  if all(t[s] == t[-(s+1)] for s in range(len(t) // 2)):
    count += 1

print(count)

Submission status: Accepted

Solution code:
A, B = list(map(int, input('').split()))
count = 0
for x in range(A, B + 1):
  t = str(x)
  ret = True
  for s in range(len(t) // 2):
    if t[s] != t[-(s+1)]:
      ret = False
      break
  if ret:
    count += 1

print(count)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int ,raw_input().split())
  
result = 0
for i in range(A,B+1):
    r = str(i)
    flg = True
    for j in range(int(len(r)/2)):
        if r[j] != r[len(r) - j - 1]:
            flg = False
    if flg:
        result += 1

print(result)

Submission status: Accepted

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

kai = []

for i in range(1,10):
    for j in range(0,10):
        for k in range(0,10):
            num = int(str(i)+str(j)+str(k)+str(j)+str(i))
            kai.append(num)
            
kai2 = filter((lambda x: x >= A and x <= B), kai)
print(len(list(kai2)))

Submission status: Accepted

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

# 入力を各変数に格納
a, b = map(int, input().split())

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

    # 数値→文字列に
    str1 = str(i)
    # 1桁目と5桁目、2桁目と4桁目がそれぞれ同じ
    if str1[0] == str1[4] and str1[1] == str1[3]:
        ans += 1
    
    i += 1

print(ans)

Submission status: Accepted

Solution code:
f, t = map(int, input().split(' '))
kaibun = 0
for s in range(f, t + 1):
     if str(s) == str(s)[::-1]:
        kaibun += 1
print(kaibun)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
ans = 0
for n in range(A,B+1):
    if n//10000 == n%10:
        if n//1000%10 == n//10%10:
            ans += 1
print(ans)

Submission status: Accepted

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

print([str(n) == str(n)[::-1] for n in range(a, b + 1)].count(True)) # 反転させたものと比較

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 and k2 == k4:
            result = result + 1;
    print(result);



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

Submission status: Accepted

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

count = 0

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

print(count)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
count = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            if(A <= 10000*i + 1000*j + 100*k + 10*j +i <= B):
                count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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