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())
L = list(range(A,B+1))
counter = 0

for i in L:
    #回文判定
    tmp = list(str(i))
    if tmp[0] == tmp[4] and tmp[1] == tmp[3]:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    count = 0
    for n in range(A, B+1):
        s = str(n)
        k = len(s)
        isPalindrome = True
        for i in range(k//2):
            if s[i] != s[k-1-i]:
                isPalindrome = False
                break
        if isPalindrome:
            count += 1
    return count

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
ab= input().split()

a = int(ab[0])
b = int(ab[1])

ans = 0
x = []
for i in range(a, b+1):
	for j in str(i):
		x.append(j)
	x.reverse()
	y = ''.join(x)
	if int(i) == int(y):
		ans += 1
	x.clear()#配列の中身を全消しする


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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc090/tasks/abc090_b


def is_palindromic(x):
    s = str(x)
    if s == s[::-1]:
        return True
    return False


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
cnt = 0
for n in range(a, b+1):
    s = list(str(n))
    rs = list(reversed(s))
    if s == rs:
        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):
    s = str(i)
    t = s[::-1]
    if s == t:
        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())
ans=0
for i in range(b+1)[a:]:
  if len(str(i))%2==0:
    p=list(str(i))[:len(str(i))//2]
    q=list(reversed(list(str(i))[len(str(i))//2:]))
    if p==q:
      ans+=1
  else:
    s=list(str(i))[:len(str(i))//2+1]
    d=list(reversed(list(str(i))[len(str(i))//2:]))
    if s==d:
      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)[0]==str(i)[-1] and str(i)[1]==str(i)[-2]:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
# 回文数になるA<= <=Bの数の個数
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1,1):
    s = str(i)
    if s == s[::-1]:
        ans += 1
print(ans)

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

print(ans)

Submission status: Accepted

Solution code:
a,b=input().split()
a,b=int(a),int(b)
#回文数でa以上で最小のもの、b以下で最大のものをそれぞれ求める
#10~99で、それぞれ10個
def kaibun(n):
    return (n//100)*100+n//10000+((n//1000)%10)*10
ka=kaibun(a)
if a>ka:
    ka+=100
kb=kaibun(b)
if b<kb:
    kb-=100
print(kb//100-ka//100+1)

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())
count = 0
for i in range(a,b+1):
  b1 = i%10
  s = i//10
  b2 = s%10
  t = s//10
  u = t//10
  a2 = u%10
  v = u//10
  a1 = v%10
  if a1 == b1 and a2 == b2:
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=[int(x) for x in 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())
print(sum(i == i[::-1] for i in map(str,range(a,b+1))))

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

    if l == list(reversed(l)):
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:

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

N = B - A + 1
Ans = 0

for i in range(N):
  TmpN = A + i
  S = str(TmpN)
  if S[0]==S[4] and S[1]==S[3]:
    Ans += 1

print(Ans)

Submission status: Accepted

Solution code:
def getORDER(n):
  order = list()
  
  while( n>0):
    order.append(n % 10)
    n //= 10
  return order

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

for i in range(A,B+1):
  order = list(getORDER(i))
  if (order[0] == order[4] and order[1] == order[3]):
    res += 1

print(res)

Submission status: Accepted

Solution code:
# 条件より絶対5桁
A, B = map(int, input().split())

cnt = 0

for i in  range(A, B+1):
    num = i
    res = []
    res_append = res.append
    while num > 0:
        q, mod = divmod(num, 10)
        res_append(mod)
        num = q
    if (res[0] == res[-1]) and (res[1] == res[-2]):
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    l = []
    tmp = i
    l.append(int(tmp%10))
    tmp /= 10
    l.append(int(tmp%10))
    tmp /= 10
    l.append(int(tmp%10))
    tmp /= 10
    l.append(int(tmp%10))
    tmp /= 10
    l.append(int(tmp%10))
    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 i in range(a, b + 1):
    t = str(i)
    b = True
    for j in range(len(t)):
        if t[j] != t[-j-1]:
            b = False
            break
    if b:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
start,end = map(int,input().split())
check1 = 0
check_array = []
count = 0

for i in range(start,end+1):
    check2 = i

    while not check2 == 0:
        check_array.append(check2 % 10)
        check2 = int(check2 / 10)

    if check_array[0] == check_array[4] and check_array[1] == check_array[3]:
        count += 1
    check_array = []

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(a,c+1):
  d = str(i)
  if d[0] == d[-1]:
    if d[1] == d[-2]:
      b.append(i)
print(len(b))

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
count = 0
for i in range(A,B + 1):
  num =[]
  while i > 0:
    
    num.append(i % 10)
    i = i//10
  num.reverse()
  if num[0] == num[4] and num[1] == num[3]:
    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)[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())
cnt = 0
for i in range(a, b+1):
    if list(str(i)) == list(str(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):
    if str(i) == str(i)[::-1]:
        ans +=1
print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
  l1=list(str(i))
  l2=l1[::-1]
  if l1==l2 :
    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)
  n = len(s)
  for j in range(n//2+1):
    if s[j] != s[-1-j]:
      break
  else:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
a, b = [int(x) for x in 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(str, input().split())
ans = 0
for i in range(int(a), int(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())
cnt = 0
for i in range(A,B+1):
    l = []
    while i > 0:
        l.append(i%10)
        i//=10
    if l==l[::-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 == s[-1::-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):
    temp = str(i)
    if temp[::] == temp[::-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
c = 0
for i in range(x, y + 1):
    if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
        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())
s=0
for C in range(a,b+1):
    C=str(C)
    c=C[::-1]
    s+=(C==c)
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(cnt)
    
main()

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

print(count)

Submission status: Accepted

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

for i in range(A, B+1):
    s_i = list(str(i))
    r_i = reversed(s_i)
    if ''.join(s_i) == ''.join(r_i):
        num += 1

print(num)

Submission status: Accepted

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

cnt = 0
for num in range(A, B + 1):
    num = str(num)
    kaibun = True
    for i in range(len(num) // 2):
        if num[i] != num[-i - 1]:
            kaibun = False
            break
    if kaibun:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
A, B = map(int, input().split())
count = 0
for i in range(B - A + 1):
    L = list(str(A + i))
    if L[0] == L[4] and L[1] == L[3]:
        count += 1
print(str(count))

Submission status: Accepted

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


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

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
  else:
    pass
print(cnt)

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[:2] == s[:-3:-1]:
    c += 1

print(c)

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 x in range(A, B+1):
    s = str(x)
    if s[0] == s[-1] and s[1] == s[-2]:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
lo, hi = map(int, input().rstrip("\n").split())
print(sum([str(i) == str(i)[::-1] for i in range(lo, hi + 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 = 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())
result = []
for i in range(A,B+1):
    if (str(i)[0] == str(i)[4]) & (str(i)[1] == str(i)[3]):
        result.append(i)
print(len(result))

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

print(count)

Submission status: Accepted

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

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
digit_half = 2

for i in range(A, B + 1):
    digit_list = [int(s) for s in str(i)]
    #digit_half = int(len(digit_list) / 2)
    for j in range(digit_half):
        if digit_list[j] != digit_list[-1 * (j + 1)]:
            break
        if j == digit_half - 1:
            count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

def check_ans(num):
  first = [i for i in str(num)]
  if first[4] == 0:
  	return 0
  elif first[0] == first[4] and first[1] == first[3]:
    return 1
  else:
    return 0

count = 0
for i in range(A, B+1):
  count += check_ans(i)
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  if i//10000==i%10and i//1000%10==i//10%10:
    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 i//10000==i%10and i//1000%10==i%100//10:
    ans+=1
print(ans)

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())
count = 0
for i in range(a,b+1):
  si = [char for char in str(i)]
  if si == list(reversed(si)):
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
# ABC 90, B - palindromic numbers
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())

def check(s: str):
    if (not str) or len(s) == 1:
        return True
    if s[0] == s[-1]:
        return check(s[1:-1])
    return False

res = 0
for i in range(a, b + 1):
    if check(str(i)):
        res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC090-B 
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 v in range(A, B + 1):
    s = str(v)
    if s[0] == s[4] and s[1] == s[3]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

#n = int(input())
#a = int(input())
a,b = list(map(int,input().split(" ")))
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(input().split())
#string = input()
#ls = [int(input()) for i in range(n)]
#ls1 = [input() for i in range(n)]
#m = int(input())
#ls2 = [input() for i in range(m)]
ans = 0
for i in range(a, b+1):
  tmp = str(i)
  flag = True
  for j in range(len(tmp)//2):
    if tmp[j] != tmp[len(tmp)-1-j]:
      flag = False
  if flag:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
A, B = map(str, input().split())
ansCnt = 0
for i in range(int(A), int(B) + 1):
    cntB = True
    for j in range(2):
        if str(i)[j] != str(i)[-j - 1]:
            cntB = False
            break

    if cntB:
        ansCnt += 1

print(ansCnt)

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 = input().split()

count = 0
Atop = int(A[:2])
Btop = int(B[:2])
Amiddle = int(A[2])
Bmiddle = int(B[2])
for j in range(Atop,Btop+1):
  for i in range(10):
    temp = j*1000 + i*100 + (j%10)*10 +(j//10)
    if int(A) <= temp <= int(B):
      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)[::-1]==str(i):
        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:
A, B = map(int, input().split())
cnt = 0
for i in range(A, B + 1):
  istr = str(i)
  if istr[0] == istr[4] and istr[1] == istr[3]:
    cnt += 1
print(cnt)

Submission status: Accepted

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

counter = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def kai(s):
  return True if s==s[::-1] else False

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

count = 0
for i in range(A,B+1):
  if kai(str(i)) == True:
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
count = 0
for i in range(A, B+1):
    a = [n for n in str(i)]
    b = list(reversed(a))
    if a == b:
        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)[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())
num = range(b+1)[a:]
ans = list()

for i in num:
    count = 0
    for j in range(len(str((i)))//2):
        if str(i)[j] == str(i)[-(j+1)]:
            count += 1
    if count == len(str(i))//2:
        ans.append(i)

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B =[int(i) for i in input().split()]
num = 0
for i in range(A,B+1):
    n = i
    s=[]
    while(n>0):
        s.append(str(n%10))
        n //= 10

    s_rev = ''.join(s[::-1])
    s = ''.join(s)
    if(s == s_rev):
        num += 1
print(num)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    s = SR(3)
    for i in range(3):
        print(s[i][i], end="")
    print()
    return

#B
def B():
    a, b = LI()
    ans = 0
    for i in range(a, b + 1):
        x = str(i)
        for k in range(len(x)//2):
            if x[k] != x[-k - 1]:
                break
        else:
            ans += 1
    print(ans)
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def main():
    a, b = map(int, input().split())
    
    ans = 0
    for i in range(a, b+1):
        s = str(i)
        flg = True
        for j in range(len(s)):
            tmp = (j * -1) -1
            if s[j] != s[tmp]:
                flg = False
        if flg == True:
            ans += 1
    
    print(ans)
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

p_number = 0

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

    if judge == 0:
        p_number += 1

print(p_number)

Submission status: Accepted

Solution code:

def judge(num):
	num_list_pre =list()
	num_list_late =list()
	num_list = list(str(num))		 
	num_list_pre.extend(num_list[:int(len(num_list)/2):])
	num_list_late.extend(num_list[int(len(num_list)/2)+1:])
	if num_list_pre == list(reversed(num_list_late)):
		return True
	else:
		return  False

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d = 0
for i in range(a, b+1):
    c = str(i)
    e = True
    for j in range(len(c)//2):
        if c[j] != c[-j-1] and e:
            e = not e
    if e:
        d += 1
print(d)

Submission status: Accepted

Solution code:
def findSumDigit(num):
    global total
    total = ""
    while num > 0:
        total += str(num % 10)
        num //= 10
    return total

def main():
    a,b = map(int, input().split())
    ans = 0
    for i in range(a,b+1):
        tmp = str(findSumDigit(i))
        if tmp == str(i):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
ans = 0
for num in range(A, B+1):
    s = str(num)
    rev_s = "".join(list(s)[::-1])

    if s == rev_s:
        ans += 1

print(ans)