K-th in the Times Table — Solution & Editorial
Binary search the VALUE: for candidate v, the count of table entries ≤ v is ∑i min(N, v/i), computable in O(N). Find the smallest v with count ≥ K.
Complexity: O(N log(N²))
Binary search the VALUE: for candidate v, the count of table entries ≤ v is ∑i min(N, v/i), computable in O(N). Find the smallest v with count ≥ K.
Complexity: O(N log(N²))