PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000199. Phân tích thành thừa số không chứa bình phương (Square Free Factorization)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Phân tích thành thừa số không chứa bình phương (Square Free Factorization)
Square Free Factorization
Phuoc Hung OJ ID: PRIME000204
Original source: SPOJ AMR10C
Problem statement
An integer is square-free if no square greater than one divides it. Factor into a product of square-free integers using the fewest factors.
Input
One integer .
Output
Print the minimum number of square-free factors greater than one whose product is .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
72
Output
3
Explanation: . Three square-free factors suffice, and at least three are needed to accommodate three copies of prime .