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


def kaibun(n):
	key = 0
	for i in range(1,n+1):
		if str(i) == str(i)[::-1]:
			key += 1
	return key

print(kaibun(B)-kaibun(A-1))

Submission status: Accepted

Solution code:
def ispalindrome(str): return 1 if str == str[::-1] else 0

a,b=map(int,input().split())
ans=0
while a<=b:
    if ispalindrome(str(a)):
        ans+=1
    a+=1
print(ans)

Submission status: Accepted

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

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[0]==a[4] and a[1]==a[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):
    if list(str(i)) == list(reversed(str(i))):
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def iskaibun(N):
    S=str(N)
    for i in range(len(S)):
        if S[i]!=S[len(S)-1-i]:
            return False
    return True
A, B = map(int, input().split())
P = 0
for i in range(A, B+1):
    if iskaibun(i):
        P+=1
print(P)

Submission status: Accepted

Solution code:




def main():
    temp=input()
    temp=list(map(int,list(temp.split(" "))))    
    a=int(temp[0])
    b=int(temp[1])
    count=0
    for i in range(a,b+1):                    
        if str(i)==str(i)[::-1]:
            count+=1
    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B

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

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

print(count)

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):
  if str(i)==''.join(reversed(str(i))):
    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, raw_input().split())
c = 0
for i in range(a, b + 1):
    x = str(i)
    if x == x[::-1]: c += 1
print c

Submission status: Accepted

Solution code:


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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
f = lambda :[int(i) for i in input().split()]

A,B = f()
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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: Runtime Error

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

c=0
for i in range(a,b+1):
  s=list(map(str,i))
  if s=reversed(s):
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
N = {} #10000以上key以下の回文数の個数
cnt = 0
for i in range(10000, 100000):
    L = list(str(i))
    if L == list(reversed(L)):
        cnt += 1
    N[i] = cnt
A, B = map(int, input().split())
print(N[B]-N[A-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
#
# abc090 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11009 11332"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """31415 92653"""
        output = """612"""
        self.assertIO(input, output)


def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        s = str(i)
        for j in range((3):
            if s[j] != s[-1-j]:
                break
        else:
            ans += 1
    print(ans)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Runtime Error

Solution code:
31415 92653

Submission status: Runtime Error

Solution code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Math;

namespace ConsoleApp15
{
    class Class404
    {
        static void Main()
        {
            var AB = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int A = AB[0], B = AB[1];
            int count = 0;
            for (int i = A; i <= B; i++)
            {
                string n1 = i.ToString();
                string n2 = string.Join("", n1.Reverse());
                if (n1 == n2) count++;
            }

            Console.WriteLine(count);
        }
    }
}

Submission status: Runtime Error

Solution code:
def f(x):
    l = len(x)
    i = 0
    while x[i] == x[l-i-1]:
        i += 1
        if i > (l//2):
            return True
            break
    return False

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

Submission status: Runtime Error

Solution code:
def f(x):
    l = len(x)
    i = 0
    while x[i] == x[l-i-1]:
        i += 1
        if i > (l//2):
            return True
            break
    return False

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

Submission status: Runtime Error

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
            ans=count_small
else:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)

Submission status: Runtime Error

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
            ans=count_small
else:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)

Submission status: Runtime Error

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
            ans=count_small
else:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)
print(count_large)
print(count_small)

Submission status: Runtime Error

Solution code:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
            ans=count_small
else:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)

Submission status: Runtime Error

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

count = 0
for i in range(a, b + 1):
    l = list(i)
    up = l[:(len(l) // 2) - 1]
    if len(l) % 2 == 0:
        dowm = reverse(l[len(l) // 2:])
    else:
        dowm = reverse(l[(len(l) // 2) + 1:])
    if up == down:
        count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
cnt = 0
for i in range(a,b+1):
  temp = str(i).sort(reverse=True)
  if str(i) == temp:
    cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
A,B = 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: Runtime Error

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: Runtime Error

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　#count++はダメ
       
print(cnt)

Submission status: Runtime Error

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　#count++はダメ
       
print(cnt)

Submission status: Runtime Error

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　#count++はダメ
       
print(count)

Submission status: Runtime Error

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　　#count++はダメ
       
print(count)

Submission status: Runtime Error

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　　#count++はダメ
       
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
Ans = 0
 
for i in range(1, N+1, 2):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        Ans += 1
 
print(Ans)

Submission status: Runtime Error

Solution code:
def isp(str): return True if str == str[::-1] else False
a=int(input())
b=int(input())
ans=0
for i in range(a,b+1):
  i_s=str(i)
  if isp:
    ans+=1
    
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def P_Number(a , b):

    ans = 0

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

    return ans

def main():
    a , b = map(int , input().split())
    print(P_Number(a , b))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B = map(int , input())
res = 0
for(n in range of (A, B+1)):
    lst = []
    while(n > 0):
        l.append(n%10)
        n //= 10
    if (l[0]==l[4] and l[1]==l[3]):
        res += 1
print(res)

Submission status: Runtime Error

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

print(cnt)

Submission status: Runtime Error

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


ans = 0
for i in range(A,B+1):
  num = map(int,list(str(i)))
  if num[1]==num[5] and num[2]==num[4]:
    ans += 1

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

ans=0

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,s=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: Runtime Error

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

Submission status: Runtime Error

Solution code:


fn main() {
    let a: i32 = read();
    let b: i32 = read();
    let mut ans = 0;
    for i in a..b+1 {
        let s: String = i.to_string();
        let s: Vec<char> = s.chars().collect();
        if s[0] == s[4] && s[1] == s[3] {
            ans += 1;
        }
    }
    println!("{}", ans);
}

// 以下関数


use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 10e9 as u64 + 7;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}

pub fn abs(n: i32) -> i32 {
    if n >= 0 {
        n
    } else {
        -n
    }
}

pub fn max(n: i32, m: i32) -> i32 {
    if n >= m {
        n
    } else {
        m
    }
}

pub fn min(n: i32, m: i32) -> i32 {
    if n <= m {
        n
    } else {
        m
    }
}

Submission status: Runtime Error

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

A, B, x, mid, count = map(int, input().split()), [], 2, 0
for i in range(A, B):
    while(i > 10):
        x.append(i % 10)
        i = int(i/10)
    count = count+1 if(x[0:mid] == x[mid:len(x)]
                       and len(x) > 0) else None
    x.clear()
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def palindromeQ(num):
  if num%10==num//10000:
    if (num%100)//10==(num//1000)%10:
      return(1)
    else:
      return(0)
  else:
    return(0)
ans=0
for i in range(A,B+1):
  ans+=palindromeQ(i)
print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,N) for(ll i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

int a,b;

string itostring(int a){
    stringstream ss;
    string res;
    ss << a;
    ss >> res;
    return res;
}

int main(){
    cin >> a >> b;
    ll ans = 0;
    FOR(i,a,b+1){
        string s = itostring(i);
        string t = s;
        reverse(ALL(s));
        if(s == t)ans++;
    }
    cout << ans << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_j=list(map(int,str(j)))
        if array_j==reversed(array_j):
            count+=1
print(count)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_i=list(map(int,str(j)))
        if array_i==reverse(array_i):
            count+=1
print(count)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    for j in i:
        array_i=list(map(int,str(i)))
        if array_i==reverse(array_i):
            count+=1
print(count)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if set(array_i)==set(reverse(array_i)):
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if array_i==reverse(array_i):
        count+=1
    print(count)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if array_i==reverse(array_i):
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
L = [int(j) for j in str(N)]
if N % sum(L) == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a=int(input(''))
for i in range(1,pow(10,a)):
    b=int(i/100000)
    c=int(i/10000%10)
    d=int(i/1000%10)
    e=int(i/100%10)
    f=int(i/10%10)
    g=int(i%10)
    if((b**5+c**5+d**5+e**5+f**5+g**5)==i):
        print(i)

Submission status: Runtime Error

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

for i in range(A,B+1):
    if i[1:2] = i[4:5]:
        a += 1
print("a")

Submission status: Runtime Error

Solution code:
A,Z = map(str, input().split())
a=[str(x) for x in A]
z=[str(x) for x in Z]
aa =int(a[0]+a[1]+a[2]+'0'+'0')
#print(aa)
zz =int(z[0]+z[1]+z[2]+'0'+'0')
#print(zz)
#gapa = (int(Z)-int(A))//100+1
gapb = (zz-aa)//100+1
cnt = 0
if aa<int(A):
    #print('A')
    cnt-=1
if zz>int(Z):
    #print('Z')
    cnt-=1
print(gapa)
print(gapb+cnt)
#print(cnt)
#print(gap+cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans = 0
for i in range(A, B+1):
  buf = str(i)
  is_par = true
  for u in range(buf.size()//2):
    if buf[u] != buf[-1-u]:
      is_par = false
      break
  if is_par:
    ans += 1
print(ans)

Submission status: Runtime Error

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


# Ar = int(A[::-1])
A = int(A)
B = int(B)

# print(Ar)
# print(A)
# print(B)

count = 0
while A <= B:
  As = str(A)
  Ar = int(As[::-1])

  if A == Ar:
    # print("Yes")
    count+=1
  else:
    # print("No")
  A +=1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(sum(s[0]==s[4]for s in map(str,range(*map(sum,enumerate(map(int,input().split()))))))if s[1]==s[3])

Submission status: Runtime Error

Solution code:
def is_palindrome(num):
  return str(num) == str(num)[-1::-1].lstrip("0")

(left, right) = (int(tok) for tok in input().split())
print(len(filter(is_palindrome, range(left, right + 1))))

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
mae=[]
usi=[]
count=0

for i in range(a,b+1):
  for j in range(len(i)):
    mae.append(i[j])
  for j in range(len(i),0,-1):
    usi.append(i[j])
  if mae==usi:
    count+=1

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

count = 0

for i in range(a, b + 1):
  if int(str(i)) == int(str(i)[::-1]):
    count += 1
  else:
    continue;

print(count)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

count = 0

for i in range(a, b + 1):
  if str(i) == str(i)[::-1]:
    count += 1
  else:
    continue;

print(count)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

count = 0

for i in range(a, b + 1):
  i = str(i)
  if i == i[::-1]:
    count += 1
  else:
    continue;

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = list(input())
b = list(input())
c = list(input())

print(a[0]+b[1]+c[2])

Submission status: Runtime Error

Solution code:
a,b = input().split(" ")
a_= int(a)
b_=int(b)
c = (b_-a_)//100

print(b-a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
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: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int A, B;

bool kaibun_5(int n) {
    bool ret = true;

    string str_n = to_string(n);
    for (int i = 0; i < 2; i++) {
        if (str_n[i] != str_n[4-i]) {
            ret = false;
        }
    }

    return ret;
}

int main() {
    cin >> A >> B;

    int ans = 0;
    for (int i = A; i <= B; i++) {
        if (kaibun_5(i)) {
            ans++;
        }
    }

    cout << ans << endl;
    
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=input().split()
a=str(int(a)-1)
def f(x):
  c=int(x[0])
  d=int(x[1])
  m=(c-1)*100+d*10
  e=int(x[2])
  g=int(x[3])*10+int(x[4])
  if g<d*10+c:
    m+=e
  else:
    m=m+e+1
  return m
print(f(b)-f(a))

Submission status: Runtime Error

Solution code:
a,b=input().split()
a=str(int(a)-1)
def f(x):
  c=int(x[0])
  d=int(x[1])
  m=(c-1)*100+d*10
  e=int(x[2])
  g=int(x[4])*10+int(x[5])
  if g<d*10+c:
    m+=e
  else:
    m=m+e+1
  return m
print(f(b)-f(a))

Submission status: Runtime Error

Solution code:
a,b=input().split()
a=str(int(a)-1)
def f(x):
  c=int(x[0])
  d=int(x[1])
  m=(c-1)*100+d*10
  e=int(x[2])
  g=int(x[4:6])
  if g<d*10+c:
    m+=e
  else:
    m=m+e+1
  return m
print(f(b)-f(a))

Submission status: Runtime Error

Solution code:
a, b =map(str, input().split())  #複数数値入力
count = 0
c = []
if int(a[3:5]) < int(a[1]+a[]):
    count += 1

count += int(b[0:3]) - int(a[0:3])

print(count)

Submission status: Runtime Error

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

count = 0
for i in range (A-1,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

count = 0
for i in range (A,B,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

a = str(A)
b = str(B)

count = 0
for i in range (A,B,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    s=list(str(i))
    k=0
    for j in range(5):
        k+=s[j]*(10**j)
    if i==k:
        ans+=1
print(ans)