Question: Please write this code in C + + . Be sure to include the concept of vectors and random numbers. Project Requirements: One day Dorothy

Please write this code in C++. Be sure to include the concept of vectors and random numbers.
Project Requirements:
One day Dorothy was wandering down the Yellow Brick Road and suddenly found \(\mathbf{N}\) baskets containing emeralds. Each basket contains an initial number of emeralds, \(\mathbf{E}\).
Dorothy picks up a basket and empties the emeralds, E, onto the ground. Each time Dorothy empties a basket, Glinda (the good witch) appears and fills the same basket with the floor of [E/2] emeralds.
Glinda gives Dorothy a number of minutes to collect as many emeralds as she can. In a single minute, Dorothy can take all the emeralds in a basket, regardless of the number of emeralds in it.
Find the maximum number of emeralds Dorothy can collect in the given number of minutes. Hint: Use a priority_queue for this program.
Find the most efficient way to do this problem. You will be graded on the conciseness, organization, readability, and efficiency of your solution.
Sample Run:
```
**** Dorothy and Emeralds ****
Enter the number of baskets: 13
Enter the number of minutes: 4
Dorothy has gathered 356 emeralds!
```
Please write this code in C + + . Be sure to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!