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

15520번 - Prime-Factor Prime 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB142767261.538%

문제

A positive integer is called a "prime-factor prime" when the number of its prime factors is prime. For example, 12 is a prime-factor prime because the number of prime factors of 12 = 2 × 2 × 3 is 3, which is prime. On the other hand, 210 is not a prime-factor prime because the number of prime factors of 210 = 2 × 3 × 5 × 7 is 4, which is a composite number.

In this problem, you are given an integer interval [l,r]. Your task is to write a program which counts the number of prime-factor prime numbers in the interval, i.e. the number of prime-factor prime numbers between l and r, inclusive.

입력

The input consists of a single test case formatted as follows.

l r

A line contains two integers l and r (1 ≤ lr ≤ 109), which presents an integer interval [l,r]. You can assume that 0 ≤ r - l < 1,000,000.

출력

Print the number of prime-factor prime numbers in [l,r].

제한

예제 입력 1

1 9

예제 출력 1

4

예제 입력 2

10 20

예제 출력 2

6

예제 입력 3

575 57577

예제 출력 3

36172

예제 입력 4

180 180

예제 출력 4

1

예제 입력 5

9900001 10000000

예제 출력 5

60997

예제 입력 6

999000001 1000000000

예제 출력 6

592955

힌트

In the first example, there are 4 prime-factor primes in [l,r]: 4, 6, 8, and 9.

출처

Contest > ICPC Japanese Alumni Group > JAG Practice Contest for ICPC Asia Regional > JAG Practice Contest for ACM-ICPC Asia Regional 2017 C번

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

출처

대학교 대회

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

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