PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000201. Giả thuyết Paul Erdős (A Conjecture of Paul Erdős)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Giả thuyết Paul Erdős (A Conjecture of Paul Erdős)
A Conjecture of Paul Erdős
Phuoc Hung OJ problem: PRIME000206
Reference: SPOJ HS08PAUL
Adaptation: one original query per PHOJ execution; subtasks are PHOJ-specific groups.
Problem statement
Count positive primes representable as for integers . Each prime is counted once, even if multiple representations exist.
Input
One positive integer (one query extracted from the original multiple-query input).
Output
Print the number of distinct qualifying primes.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
10
Output
2
Explanation: and are the qualifying primes at most . No other prime in the range has the required representation.