PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000167. Số không chứa lập phương (Cube Free 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
Số không chứa lập phương (Cube Free Numbers)
Cube Free Numbers
Source: SPOJ CUBEFR — https://www.spoj.com/problems/CUBEFR/
Edition: Phuoc Hung OJ Extended; one dataset per program run. Subtasks are authored for PHOJ, not claimed to be official.
Problem
A positive integer is cube-free if it is not divisible by for any integer . If is cube-free, return its 1-based rank among all cube-free positive integers; otherwise report that it is not cube-free.
Input
One integer (the original batch counter is removed for single-case PHOJ).
Output
Print Case 1: k for a valid rank, or Case 1: Not Cube Free otherwise.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
10
Output
Case 1: 9
Explanation
Among the numbers from to , only is divisible by a cube greater than , so has cube-free rank .