PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000158. Đếm các số không biểu diễn được thành lũy thừa (Unexpressed)
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 các số không biểu diễn được thành lũy thừa (Unexpressed)
Unexpressed
Source: AtCoder ABC193 C
Version: Phuoc Hung OJ Extended — one dataset per judge run.
Problem Statement
Given , count integers in that cannot be represented as for integers and .
Input
One line containing the integer .
Output
Print the number of unexpressible integers.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
8
Output
6
Explanation
Only and can be expressed as nontrivial powers. The remaining six numbers are counted.