PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000160. Lũy thừa bậc p lớn nhất (Perfect P-th Powers)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Lũy thừa bậc p lớn nhất (Perfect P-th Powers)
Perfect P-th Powers
Source: UVa 10622 — https://onlinejudge.org/external/106/10622.pdf
Edition: Phuoc Hung OJ Extended; one dataset per program run. Subtasks are authored for PHOJ, not claimed to be official.
Problem
Given an integer with , find the largest positive integer for which for an integer . For negative , must be odd.
Input
One integer .
Output
Output the greatest .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): , .
Example
Input
1073741824
Output
30
Explanation
, hence the largest exponent is .