MYQ10 - Mirror Number
A number is called a mirror number if on lateral inversion, it gives the same number i.e. it looks the same in a mirror. For example 101 is a mirror number while 100 is not.
Given two numbers a and b, find the number of mirror numbers in between them (inclusive of a and b).
Input
First line contains T, number of test cases <= 10^5.
Each test case is described in a single line containing two numbers a and b.
0 <= a <= b <= 10^44
Output
For each test case print the number of mirror numbers between a and b in a single line.
Example
Input: 3
0 10
10 20
1 4 Output: 3
1
1
hide comments
darryl:
2013-09-20 14:16:42
I learned that checking for 0 to 10^44 is not all that reliable. Brute force check for small numbers is the best. |
|
Aastha Dua:
2013-08-25 09:44:45
can anyone plz post some test cases.. i m getting WA again and again..but i think my code is giving correct outputs.. even for 0 to 10^44 also, i am getting 62762119217..plz reply asap. |
|
Ashish Lavania:
2012-12-19 19:04:21
@Jack
|
|
Ehor Nechiporenko:
2012-08-16 09:26:45
Is the solution for
|
|
(Tjandra Satria Gunawan)(曾毅昆):
2012-07-21 18:03:05
first step: bruteforce it --> TLE
|
|
:D:
2012-05-24 18:52:48
Is it like a led display?
|
|
Mitch Schwartz:
2012-03-01 23:15:12
Notice that these are not the same as palindromes. I think it's easy to miss if you don't read carefully. |
Added by: | jack(chakradarraju) |
Date: | 2012-02-14 |
Time limit: | 1s-1.829s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Bytecode 2012 |