![zitterkoph](/avatars/234.jpg)
zitterkoph
19.11.2019 •
Mathematics
You are given an array a representing heights of students. all the students are asked to stand in rows. the students arrive by one, sequentially (as their heights appear in a). for the i-th student, if there is a row in which all the students are taller than a[i], the student will stand in one of such rows. if there is no such row, the student will create a new row. your task is to find the minimum number of rows created. test cases
Solved
Show answers
More tips
- F Food and Cooking How to Make Shortcrust Pastry: Recipe and Tips...
- H Horoscopes, Magic, Divination Is there a 13th Zodiac Sign?...
- H Health and Medicine Want to Lose Weight? Gain Muscle without Damaging Your Health!...
- F Family and Home Parquet or laminate, which is better?...
- L Leisure and Entertainment How to Properly Wind Fishing Line onto a Reel?...
- L Leisure and Entertainment How to Make a Paper Boat in Simple Steps...
- T Travel and tourism Maldives Adventures: What is the Best Season to Visit the Luxurious Beaches?...
- H Health and Medicine Kinesiology: What is it and How Does it Work?...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
Answers on questions: Mathematics
- M Mathematics Identify the equation as an equation containing fractions, a fractional equation or, a proportion. (2x/x+7)-(x/x+3)=1+(1/x^2+10+21)...
- M Mathematics Please help will give brainliest...
- M Mathematics All of the following conditions in Earth can cause metamorphic rocks to form EXCEPT . A.Pressure. B.the presence of hot watery fluids. C.heat. D.exposure to air....
- M Mathematics How many seconds are in 20 days math ??...
- M Mathematics Which of the equations matches the model shown below?...
- M Mathematics What is 1/4 divided by 2 in simplest form...
- M Mathematics 2/3 of the fish in Gary’s fish tank I guppies 1/4 of the guppies are red. what fraction of the fish and Gary’s tanks are red guppies? What faction of the fish are not red...
- M Mathematics What value of k will make this relationship NOT a function? {(-7, 2), (-1,0), (4,8), (k, 0)} A) 2 B) -7 C) 8...
- M Mathematics Find the coordinates of the intersection of the diagonals of parallelogram GHJK with vertices G (-2, 3), H (4, 4), J (2, -1), and K(-4, - 2)....
- M Mathematics R. S 105 M N 45° U 13. m 14. m 15. m 16. m 17. m 18. m O...
Ответ:
The minimum number of rows is 1: if A is sorted in descending order, every next students will arrive in a row where everyone is taller than him, and no new rows will be created.
For example, consider
A = [190, 175, 170, 165, 150]
The first students creates the first row.
The second student is 175cm tall. In the first row everyone is taller than him (there's only the 190cm student), so he'll stand in this row.
The third student, 170cm, will find the row filled by the students who are 190 and 175cm tall. So, everyone is taller than him and he'll stand in that row as well.
You keep going with the other students, and you'll see that no one will form a new row.
Ответ:
The output is approximately 0.296630 but it rounds to 0.3 which is the answer
Step-by-step explanation: