8 kyu

The falling speed of petals

3,982 of 17,084Uxie

Description:

When it's spring Japanese cherries blossom, it's called "sakura" and it's admired a lot. The petals start to fall in late April.

Suppose that the falling speed of a petal is 5 centimeters per second (5 cm/s), and it takes 80 seconds for the petal to reach the ground from a certain branch.

Write a function that receives the speed (in cm/s) of a petal as input, and returns the time it takes for that petal to reach the ground from the same branch.

Notes:

  • The movement of the petal is quite complicated, so in this case we can see the velocity as a constant during its falling.
  • Pay attention to the data types.
  • If the initial velocity is non-positive, the return value should be 0
Algorithms

Stats:

CreatedNov 15, 2017
PublishedNov 15, 2017
Warriors Trained22806
Total Skips332
Total Code Submissions56807
Total Times Completed17084
C++ Completions3982
Python Completions5562
C# Completions1211
Ruby Completions559
JavaScript Completions6128
TypeScript Completions237
Julia Completions49
Total Stars112
% of votes with a positive feedback rating84% of 1905
Total "Very Satisfied" Votes1435
Total "Somewhat Satisfied" Votes340
Total "Not Satisfied" Votes130
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Uxie Avatar
  • jhoffner Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • msharp9 Avatar
  • Blind4Basics Avatar
  • Souzooka Avatar
  • Avanta Avatar
  • FArekkusu Avatar
  • KiparD Avatar
  • ejini战神 Avatar
  • rge123 Avatar
Ad