Tap here to switch tabs
Problem
Submissions

Problem: Count K-th Roots in a Range

Try to solve the Count K-th Roots in a Range problem.

Statement

Given three integers l, r, and k, return the number of integers in the inclusive range [[l, r]] that can be represented as nkn^k for some integer n≥0n \geq 0.

Constraints:

  • 0≤0 \leq l ≤\leq r ≤109\leq 10^9

  • 1≤1 \leq k ≤30\leq 30

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count K-th Roots in a Range

Try to solve the Count K-th Roots in a Range problem.

Statement

Given three integers l, r, and k, return the number of integers in the inclusive range [[l, r]] that can be represented as nkn^k for some integer n≥0n \geq 0.

Constraints:

  • 0≤0 \leq l ≤\leq r ≤109\leq 10^9

  • 1≤1 \leq k ≤30\leq 30