| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 128 MB | 153 | 117 | 107 | 76.429% |
The digits 0ドル,ドル 1ドル,ドル and 8ドル$ look much the same if rotated 180ドル$ degrees on the page (turned upside down). Also, the digit 6ドル$ looks much like a 9ドル,ドル and vice versa, when rotated 180ドル$ degrees on the page. A multi-digit number may also look like itself when rotated on the page; for example 9966ドル$ and 10ドル,801円$ do, but 999ドル$ and 1234ドル$ do not.
You are to write a program to count how many numbers from a given interval look like themselves when rotated 180ドル$ degrees on the page. For example, in the interval $[1 \dots 100]$ there are six: 1ドル,ドル 8ドル,ドル 11ドル,ドル 69ドル,ドル 88ドル,ドル and 96ドル$.
Your program should take as input two integers, $m$ and $n,ドル which define the interval to be checked, 1ドル \le m \le n \le 32,000円$. The output from your program is the number of rotatable numbers in the interval.
You may assume that all input is valid.
1 100
6