Logo
(追記) (追記ここまで)

6942번 - 9966 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB15311710776.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

1
100

예제 출력 1

6

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2000 > CCC 2000 Junior Division 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /