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:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    a, b = i_map()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
'''
リストや文字列の並び替え
↓↓↓
https://note.nkmk.me/python-reverse-reversed/
'''
a,b=map(int,(input().split()))
ans=0

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

Submission status: Accepted

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

ans = 0
for i in range(A,B+1,1):
    tmp = list(str(i))
    is_kai = True
    for j in range(0,len(tmp),1):
        if tmp[j]!=tmp[len(tmp)-1-j]:
            is_kai=False
            break
    if is_kai:
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

for index in range(A, B+1):
    s = str(index)
    if s[:2] == s[5:2:-1]: ret += 1

print(ret)

Submission status: Accepted

Solution code:
A,B = (int(X) for X in input().split())
Count = 0
for T in range(A,B+1):
    StrT = str(T)
    if StrT[0:2]==StrT[3:5][::-1]:
        Count += 1
print(Count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
N = 0
res = 0
def checkPali(n):
  # n = 100*a + 10*b +c
  c = n%10
  a = n//10000
  b = (n - 10000*a)//1000
  d = (n - c)/10
  e = d%10
  if a == c and b == e:
    return True
  else:
    return False
for i in range(B-A+1):
  N = A + i
  if checkPali(N):
    res+=1
print(res)

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

ans_list = [x for x in range(A, B+1) if list(str(x)) == list(reversed(str(x)))]
print(len(ans_list))

Submission status: Accepted

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

ans = 0
for x in range(A,B+1):
  x = list(str(x))
  rev_x = x[::-1]
  
  if x == rev_x:
    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:
M = input().split()
a = int(M[0])
b = int(M[1])
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:
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())
count = 0
for i in range(A,B+1):
    if str(i) == str(i)[::-1]:
        count+=1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])

def palindromic(x):
    y = list(x)
    if not y[0] == y.pop():
        return False
    if not y[1] == y.pop():
        return False
    return True

answer = 0

for i in range(a, b + 1):
    if palindromic(str(i)):
        answer += 1
    
print(answer)

Submission status: Accepted

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

ans = 0
for i in range(a, b + 1):
    si = str(i)
    l = len(si)
    check = True
    for j in range(l // 2):
        if si[j] != si[(-j - 1)]:
            check = False
            break
    if check:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b = map(int, input().split())
    r = 0
    for i1 in range(a, b + 1):
        c1 = i1 // 10000 == i1 % 10
        c2 = ((i1 // 1000) % 10) == ((i1//10)%10)
        r += c1 and c2
    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b = map(int, input().split())
    r = 0
    for i1 in range(a, b + 1):
        stri1 = str(i1)
        r += stri1 == stri1[::-1]

    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#45
A,B = map(int,input().split())
cnt = 0
num1,num2 = "",""
for i in range(A,B+1):
    num1 = str(i)
    num2 = num1[::-1]
    if num1 == num2:
        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:
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):
  temp=[x for x in str(i)]
  if temp==temp[::-1]:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(" "))
count = 0
for v in range(a, b + 1):
    v1 = v % 10
    v2 = v // 10 % 10
    v3 = v // 100 % 10
    v4 = v // 1000 % 10
    v5 = v // 10000 % 10
    if v1 == v5 and v2 == v4:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
    f = True
    str_i = str(i)
    lim = int(len(str_i) / 2)
    for j in range(lim):
        if str_i[j] != str_i[-j-1]:
            f = False
    if f:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0
tmp_left = ''
tmp_right = ''

for x in range(A, B + 1):
    tmp_left = str(x)[0] + str(x)[1]
    tmp_right = str(x)[-1] + str(x)[-2]
    if tmp_left == tmp_right:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    a, b = map(int, input().split())
    ans = 0
    for n in range(a, b + 1):
        c = str(n)
        l = len(c)
        circle = True
        for i in range(l // 2):
            if c[i] != c[-i-1]:
                circle = False
                break
        if circle: ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = 0
for i in range(A,B+1):
    s = str(i)
    N = len(s)-1
    l = (len(s) // 2) + 1
    for j in range(l):
        if s[j] == s[N-j]:
            continue
        else:
            break
    else:
        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[4] and s[1] == s[3]:
        ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b = map(int, open(0).read().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())

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

print(answer)

Submission status: Accepted

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

Solution code:
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
    if all(str(i)[j]==str(i)[len(str(i))-1-j] for j in range(len(str(i))//2))==True:
            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())
k=0
for i in range(A,B+1):
    if i//10000-i%10==0:
        j=i%10000//10
        if j//100-j%10==0:
            k=k+1


            
print(k)

Submission status: Accepted

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

ans = 0
def palindrome(string): return 0 if string==string[::-1] else 1
for i in range(A, B+1):
    if palindrome(str(i)) == 0 :
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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())
t = 0

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

print(t)

Submission status: Accepted

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

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

print(ans)

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:
def check(i):
    i = str(i)
    return i[:2] == i[4:2:-1]

A, B = map(int, input().split())
res = sum(check(i) for i in range(A, B+1))
print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, input().split())

ans = 0

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

    if k == gk:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
A,B = map(int,input().split())
if not ( 10000 <= A <= B <= 99999 ):
    sys.exit()

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())
number_list = list(range(a, b + 1))
ans = []
for i in range(len(number_list)):
    str_number = str(number_list[i])
    len_number = len(str_number)
    count = 0
    for j in range(len_number // 2):
        if str_number[j] != str_number[-1 - j]:
            break
        count += 1
    if count == len_number // 2:
        ans.append(str_number)
print(len(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=[int(i) for i in 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())

cnt = 0
for i in range(a, b+1):
  i = str(i)
  if all([i[0] == i[4], i[1] == i[3]]):
    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[::] == x[::-1]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
def actual(A, B):
    is_palindrome = lambda i: str(i) == str(i)[::-1]

    return sum([is_palindrome(num) for num in range(A, B + 1)])

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

Submission status: Accepted

Solution code:
data = [int(i) for i in input().split(' ')]
A = data[0]
B = data[1]

count = 0
for i in range(A, B+1):
    i = str(i)
    l = len(str(i))
    l_half = l//2
    for j in range(l_half):
        if j == l_half-1:
            if i[j]==i[l-1-j]:
                count += 1
        if i[j]==i[l-1-j]:
            continue
        else:
            break
        
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = [int(w) for w 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, 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())
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())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for i in range(a, b+1):
    tmp = str(i)
    if tmp == tmp[::-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)
  n=len(s)
  j=True
  for x in range(n//2):
    if s[x]!=s[-1-x]:
      j=False
      
  if j:
    ans+=1
    
print(ans)

Submission status: Accepted

Solution code:
import numpy as np


def split_digits(n):
  digits = []
  while n > 0:
    digits.append(n % 10)
    n = int(n / 10)
  return digits


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

for i in range(a, b + 1):
  digits = np.array(split_digits(i))
  if (digits == digits[::-1]).all():
    c += 1
    
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

A, B = map(int, input().split())
n = 0
i = A
while i <= B:
    L = list(str(i))
    if L[0] == L[4] and L[1] == L[3]:
        n += 1
    i += 1
print(n)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
cnt = 0
import math

for i in range(a,b+1):
    if i%10 == math.floor(i/10000)%10 and math.floor(i/10)%10 == math.floor(i/1000)%10:
        cnt = cnt + 1
        
print(cnt)

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

Submission status: Accepted

Solution code:
a,b=input().split()
ans=0
for i in range(int(a),int(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):
    tmp=str(i)
    n=len(tmp)
    c=0
    for j in range((n+1)//2):
        if tmp[j]==tmp[-j-1]:
            c+=1
    if c==(n+1)//2:
        ans+=1
print(ans)

Submission status: Accepted

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

cnt = 0
for i in range(A, B + 1):
    s = str(i)
    l = 0
    r = len(s) - 1
    while l < r and s[l] == s[r]:
        l += 1
        r -= 1
    if l >= r:
        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==s[::-1]:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import numpy as np
#import functools
#import operator
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm
#import collections as C #most_common
#import math


#N = int(input())
N,K= map(int,input().split())
#P = list(map(int,input().split()))
#S= str(input())
c=0
for i in range(N,K+1):
    i=list(str(i))
    j=list(reversed(i))
    if i==j:
        c+=1
print(c)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print(sum(str(n)==str(n)[::-1] for n 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):
    if str(i)==str(i)[::-1]:
        cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y=map(int, input().split())
cnt=0
for i in range(9):
	for j in range(10):
		for k in range(10):
			a=10001*(i+1)+100*k+1010*j
			if y>=a>=x:
				cnt+=1
print(cnt)

Submission status: Accepted

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

for i in range(A, B+1):
  a = str(i)
  b = ''.join(list(reversed(a)))
  if a == b:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
def is_palindromic(N):
    N_reversed=list(str(N))
    N_reversed.reverse()
    N_reversed=int(''.join(N_reversed))
    if N_reversed==N:
        return True
    else:
        return False
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
    if is_palindromic(i):
        count+=1
print(count)

Submission status: Accepted

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

count = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            num = int(str(i) + str(j) + str(k) + str(j) + str(i))
            if A <= num <= B:
                count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
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:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

A,B = I()
ans = 0
for i in range(A,B+1):
    F = 1
    s = str(i)
    for i in range(2):
        if s[i] != s[4-i]:
            F = 0
    if F == 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):
  t=str(i)
  if t==t[::-1]:
    ans+=1
print(ans)

Submission status: Accepted

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

def solve():
    a, b = map(int, input().split())
    ans = 0
    for i in range(a, b+1):
        if kaibu(i) == True:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
# https://atcoder.jp/contests/abc090/tasks/abc090_b
# 全探索でよくね？


def is_cycle(x):
    x = str(x)
    return x == x[::-1]


ans = 0
for x in range(A, B + 1):
    ans += is_cycle(x)
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b=nii()
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:
def checkpalindrome(n):
  s=str(n)
  a=[]
  for i in range(len(s)):
    a.append(s[i])
  a.reverse()
  if ''.join(a)==s:
    return 1
  else:
    return 0
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  ans+=checkpalindrome(i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

A, B = mapint()

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

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)
    f = True
    for j in range(len(s) // 2):
        if s[j] != s[-j-1]:
            f = False
            break
    if f:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
ans=0
for i in range(A,B+1):
  a=str(i)
  b=a[::-1]
  if a==b:
    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)
    flag = False
    for i in range(len(s)):
        if s[i] != s[len(s) - i - 1]:
            flag = True
    if not flag:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# check
cnt = 0
for n in range(A, B + 1):
    if str(n) == str(n)[::-1]:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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