Tap here to switch tabs
Problem
Submissions

Problem: Super Egg Drop

Super Egg Drop gives you identical eggs and a building with an unknown threshold floor: eggs break above it and survive at or below it. Return the fewest drops needed to find it with certainty.

Statement

You are given k identical eggs and a building with n floors numbered from 11 to n.

There exists a floor f satisfying 0≤0 \leq f ≤\leq n such that:

  • Any egg dropped from a floor strictly higher than f will break.

  • Any egg dropped from floor f or below will not break.

In each move, you can choose any floor x where 1≤1 \leq x ≤\leq n and drop an unbroken egg from it. If the egg breaks, you can no longer use it. If the egg does not break, you can reuse it in future moves.

Return the minimum number of moves required to determine the exact value of f with certainty under the worst case scenario.

Constraints:

  • 1≤1 \leq k ≤100\leq 100

  • 1≤1 \leq n ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Super Egg Drop

Super Egg Drop gives you identical eggs and a building with an unknown threshold floor: eggs break above it and survive at or below it. Return the fewest drops needed to find it with certainty.

Statement

You are given k identical eggs and a building with n floors numbered from 11 to n.

There exists a floor f satisfying 0≤0 \leq f ≤\leq n such that:

  • Any egg dropped from a floor strictly higher than f will break.

  • Any egg dropped from floor f or below will not break.

In each move, you can choose any floor x where 1≤1 \leq x ≤\leq n and drop an unbroken egg from it. If the egg breaks, you can no longer use it. If the egg does not break, you can reuse it in future moves.

Return the minimum number of moves required to determine the exact value of f with certainty under the worst case scenario.

Constraints:

  • 1≤1 \leq k ≤100\leq 100

  • 1≤1 \leq n ≤104\leq 10^4