6. Jumping Frog

Difficulty: 

A frog can either hop 5 cm or jump 10 cm forward. Calculate how many different ways there are for the frog to move forward by a given distance. For example, the frog can move forward 15 cm in 3 different ways: "hop->hop->hop", "jump->hop", and "hop->jump". The maximum distance is 4 meters.

Input:

jumpingFrog(20);

Output:

5

Time Limit:

250 (ms)

Hint (hover to see):

  • Hint #1



Results

ProblemsAcceptedWrongTimed OutError
150000

Input:

Expected Output:

Output: