PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000198. Nhận biết số hoàn hảo theo số mũ (Perfect 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
Nhận biết số hoàn hảo theo số mũ (Perfect Numbers)
Perfect Numbers
Phuoc Hung OJ ID: PRIME000203
Original source: UVa 1180
Problem statement
Given , determine whether is a perfect number, meaning it equals the sum of its positive proper divisors.
Input
One integer .
Output
Print exactly Yes if is perfect, or No otherwise.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
7
Output
Yes
Explanation: is prime; by the Euclid–Euler theorem, is perfect.