PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000169. Đếm số không chứa bình phương (Square-free Integers)
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 số không chứa bình phương (Square-free Integers)
Square-free Integers
Phuoc Hung OJ problem: PRIME000174
Reference: SPOJ SQFREE
Adaptation: one original query per PHOJ execution; subtasks are PHOJ-specific groups.
Problem statement
A positive integer is square-free if it is not divisible by for any integer . Given , count positive square-free integers not exceeding .
Input
One positive integer . (PHOJ version: one query per execution.)
Output
Print the required count.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
1000
Output
608
Explanation: Exactly integers in are not divisible by any square larger than one; is included.