Problem:


Score : 200 points

Problem Statement

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

Constraints

10000 \leq A \leq B \leq 99999

All input values are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

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

Sample Input 1

11009 11332

Sample Output 1

4

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

Sample Input 2

31415 92653

Sample Output 2

612



Sample input:
11009 11332


Sample output:
4

Submission status: Accepted

Solution code:
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    a, b = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    cnt = 0
    for i in range(a, b+1):
        N=[]
        j = i
        while j >= 1:
            N.append(j % 10)
            j = j // 10
 #       print(N)
        if N == list(reversed(N)):
            cnt += 1

    print(cnt)
resolve()

Submission status: Accepted

Solution code:
from sys import stdin


def find_palindromic(s):
    TF = False
    for i in range(len(s)//2):
        if s[i] != s[-i-1]:
            break
    else:
        TF = True
    return TF


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    A, B = list(map(int,_in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    for i in range(A,B+1):
        if find_palindromic(str(i)):
            cnt += 1
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

a,b=MI()
def kaibunn(n):
    u=str(n)
    if u[0]==u[4] and u[1]==u[3]:
        return 1
    else:
        return 0
ans=0
for i in range(a,b+1):
    ans+=kaibunn(i)
print(ans)

Submission status: Accepted

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

count = 0
for i in range(A, B+1):
    num = list(str(i))
    num_r = []
    for i in range(len(num)):
        num_r.append(num[-(i+1)])
    if num == num_r:
        count += 1
    else:
        continue

print(count)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    moji = str(i)
    flag = True
    for j in range(1,len(moji)//2+1):
        if moji[j-1]!=moji[-j]:
            flag = False
            break
    if flag:
        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 i//10000 == i%10:
        if i%10000//1000 == i%100//10:
            count +=1
            
print(count)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


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


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


show_flg = False
# show_flg = True


def main():
    A, B = MI()
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

print(c)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
cnt=0
for i in range(a,b+1):
    i = str(i)
    if i==i[::-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):
  j1 = str(i)
  j2 = ''.join(list(reversed(j1)))
  if j1 == j2:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    c = list(str(i))
    d = c[:2]
    e = c[:2:-1]
    if d == e:
        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):
    strI = str(i)
    if strI[0] == strI[-1] and strI[1] == strI[-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):
  lst = list(str(i))
  lst2 = lst[::-1]
  temp=''.join(lst2)
  if str(i) == temp:
    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)[0]==str(i)[4] and str(i)[1]==str(i)[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)[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())
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())

ans = 0
for i in range(A, B+1):
    S = str(i)
    n = len(S)
    if n%2 == 0:
        m = n//2
        x = S[:m]
        y = S[m:]
    else:
        m = n//2
        x = S[:m]
        y = S[m+1:][::-1]
    if x == y:
        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)
    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())
ans= 0
for i in range(a,b+1):
  ans += str(i)==str(i)[::-1]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC090
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:
# -*- coding: utf-8 -*-

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

def isPalindrome(s):
    if s[0]==s[4] and s[1]==s[3]:
        return True
    return False

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

Submission status: Accepted

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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


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

print(res)

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

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 sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
cnt = 0
for i in range(A, B+1):
	if str(i) == str(i)[::-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:
a, b = [int(n) for n in input().split(' ')]

cnt = 0
for n in range(a, b+1):
    sn = str(n)
    if sn == sn[::-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 == s[::-1]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def palindrome(string): return True if string==string[::-1] else False
ans = 0
for i in range(a, b+1):
    if palindrome(str(i)):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# 2020/04/25
# AtCoder Beginner Contest 090 - B

# Input
a, b = input().split()

# Calc
va = int(a)
vb = int(b)
ans = 0

for i in range(va, vb+1):
    j = 0
    si = str(i)
    kbflg = True
    while j < len(si) // 2:
        if si[j] != si[len(si)-1-j]:
            kbflg = False
        j = j + 1

    if kbflg:
       ans = ans + 1
#       print(i)

# Output
print(ans)

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

Solution code:
A,B=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:
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):
    str_i = str(i)
    if str_i[0] == str_i[-1] and str_i[1] == str_i[-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[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):
    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)[::-1]==str(i):
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc090/tasks/abc090_b
a, b = map(int, input().split())

ans = 0
for i in range(a, b + 1):
    num = str(i)
    h = 0
    t = len(num) - 1
    while h <= t:
        if num[h] == num[t]:
            h += 1
            t -= 1
        else:
            break
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
quotient = 0
mod = 0
ans=0
for i in range(A,B+1):
	num=[]
	quotient=i
	while quotient !=0:
		mod= quotient%10
		quotient = quotient//10
		num.append(mod)
	if num[0]==num[4] and num[1]==num[3]:
		ans =ans+1
print(ans)

Submission status: Accepted

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

count = 0
for i in range(A, B + 1):
    s = str(i)
    L = len(s)
    if (s[L - 1] == '0'):
        # print(s)
        continue
    r = list(reversed(s))
    ner = ''.join(r)
    # print(ner)
    # print(s)
    if (s == ner):
        # print('done')
        count += 1

print(count)

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())
cnt=0
def is_pal(s):
    s_str=str(s)
    s_rev=str() 
    for i in range(1,len(str(s))+1):
        s_rev+=s_str[-i]
    
    if s_str==s_rev:
        return True
    else:
        return False
for i in range(A,B+1):
    if is_pal(i):
        cnt+=1
print(cnt)

Submission status: Accepted

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

def main():
    A, B = map(int, readline().rstrip().split())
    ans = 0
    for i in range(A, B+1):
        if str(i) == str(i)[::-1]:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A, B = map(int, readline().split())
    ans = 0
    for i in range(A,B+1):
        s = str(i)
        if s[:2]==s[5:2:-1]:
            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)
  if s == s[::-1]:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
import math


[A, B] = list(map(int, stdin.readline().rstrip().split()))

def isKaibun(n):
    s = str(n)
    for i in range(len(s)//2):
        if s[i] == s[-(i+1)]:
            continue
        else:
            return False
    return True


count = 0
for i in range(A,B+1):
    if isKaibun(i):
        count = count + 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

i=A
ans=0
while i<=B:
    ans+=1*(i==int(str(i)[::-1]))
    i+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

for i in range(A, B+1):
    # print(list(str(i)), reversed(list(str(i))))
    if list(str(i)) == list(reversed(list(str(i)))):
        count += 1
    # break
print(count)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in l:
    if i[0] == i[4]:
        if i[1] == i[3]:
            ans += 1
print(ans)

Submission status: Accepted

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

result = 0
for num in range(A, B+1):
    num_list = list(str(num))
    if (num_list[0] == num_list[4]) and (num_list[1] == num_list[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):
  j=str(i)
  flg=True
  for k in range(len(j)//2):
    if j[k]!=j[-k-1]:
      flg=False
      break
  if flg:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
ans = 0
for j in range(A,B+1):
    i = str(j)
    if str(i[0]) == str(i[4]) and str(i[1]) == str(i[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):
  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())
r = 0
for i in range(a, b + 1):
    r+= str(i) == str(i)[::-1]
print(r)

Submission status: Accepted

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

    print(r)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
l=[0,0,0,0,0]
cnt=0
for i in range(a,b+1):
    x=i
    d=0
    while x>0:
        l[4-d]=x%10
        x=int(x/10)
        d+=1

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

print(cnt)

Submission status: Accepted

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

    if flg:
        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())
count = 0
for i in range(A,B+1):
	a = i // 10000
	b = i // 1000 - a*10
	c = i % 10
	e = i // 100 - a*100 - b * 10
	d = i // 10 - a*1000 - b * 100 - e *10
	if a == c and b == d :
		count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
cnt=0
for i in range(A,B+1):
    i=str(i)
    if len(i)%2==0:
        if i[0:(len(i)/2)]==(i[(len(i)/2):])[::-1]:
            cnt+=1
        else:
            continue
    elif len(i)%2!=0:
        if i[0:(len(i)//2)+1]==(i[(len(i)//2):])[::-1]:
            cnt+=1
        else:
            continue
    else:
        continue
print(cnt)

Submission status: Accepted

Solution code:
import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
DP2 = lambda d1, d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1, d2, d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]

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

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

Submission status: Accepted

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

answer=0
for i in range(A,B+1):
  list_i=list(str(i))
  list_i_reverse=list_i[::-1]
  if tuple(list_i)==tuple(list_i_reverse):
    #print(i)
    answer+=1
    
print(answer)

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:

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

for i in range(a,b+1):
    x = list(str(i))
    y = x.copy()
    y.reverse()
    if x == y:
        count += 1

print(count)

Submission status: Accepted

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

counter=0 #答え（初期化）

i=A

while i<=B:
    #回文になっているか判定
    temp=str(i) #文字列に置き換え
    if (temp[0]==temp[4])and(temp[1]==temp[3]): #スライスして0番目の文字と4、1と3が一致するか判定
        counter+=1 #一致すれば、counterを増やす
    i+=1 #インクリース

print(counter)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# slist = "abcdefghijklmnopqrstuvwxyz"
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)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(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:
# solution
import io

n,m=map(int,input().split())
counter=0
for i in range(n,m+1):
  il=list(str(i))
  if il==list(reversed(il)):
    counter+=1
print(counter)

Submission status: Accepted

Solution code:
# Problem: https://atcoder.jp/contests/abc090/tasks/abc090_b
# Python 3rd Try

import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def checkParin(checkNum):
    result = False
    checkNumStr = str(checkNum)
    checkNumStrBase = checkNumStr[::-1]
    charEq = 0
    for j in range(0, len(checkNumStrBase)):
        if checkNumStr[j] == checkNumStrBase[j]:
            charEq = charEq + 1
    if charEq == len(checkNumStr):
        result = True
    return result


def solver(fromNum, toNum):
    result = 0
    j = fromNum
    while ((fromNum <= j) and (j <= toNum)):
        if checkParin(j):
            result = result + 1
        j = j + 1
    return result


if __name__ == "__main__":
    A, B = MI()
    print("{}".format(solver(A, B)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
# ABC 090: B – Palindromic Numbers
a, b = map(int, input().split())
nums = 0
for i in range(a, b + 1):
    i_str = str(i)
    nums = nums + 1 if i_str == i_str[::-1] else nums
print(nums)

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

print(ans)

Submission status: Accepted

Solution code:
def myAnswer(A:int,B:int)-> int:
   total = 0
   for i in range(A,B+1):
      tmp =str(i)
      if(tmp[:2]==tmp[:2:-1]):
         total+=1
   return total

def modelAnswer():
   tmp=1
def main():
   A, B = map(int,input().split())
   print(myAnswer(A,B))

if __name__ == '__main__':
   main()

Submission status: Accepted

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

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 = list(str(i))
    s.reverse()
    s = ''.join(s)
    if s == str(i):
        ans += 1

print(ans)

Submission status: Accepted

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

counter = 0

for i in range(B-A+1):
    n = A + i
    s = list(str(n))
    st = ""
    for j in range(5):
        st += s[4-j]
    if int(st) == n:
        counter += 1
    else:
        continue

print(counter)

Submission status: Accepted

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

counter = 0

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

Submission status: Accepted

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    s = []
    t = []
    c = str(i)
    for j in range(len(c)):
        s.append(c[j])
        t.append(c[len(c)-j-1])
    if s == t:
        ans+=1
print(ans)

Submission status: Accepted

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


def solve(A: int, B: int):
    print(sum(
        1
        for i in range(A, B + 1)
        if str(i) == str(i)[::-1]
    ))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
count = 0
for i in range(A, B+1):
    # A以上B以下の数各々に対して
    if str(i)[0]==str(i)[-1] and str(i)[1]==str(i)[-2]:
        count += 1
print(count)