PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000156. Đếm hợp số lũy thừa nguyên tố trong đoạn (Almost Prime Numbers)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm hợp số lũy thừa nguyên tố trong đoạn (Almost Prime Numbers)
Almost Prime Numbers
Source: UVa 10539
Version: Phuoc Hung OJ Extended — one dataset per judge run.
Problem Statement
An almost-prime number is a composite integer with exactly one distinct prime divisor, equivalently with prime and . Given and , count such values in the inclusive interval .
Input
One line containing and .
Output
Print the number of almost-primes in .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
1 20
Output
4
Explanation
The values are , , , and . Thus there are four almost-primes.