Question: please help to solve this problem using python with dynamic programming! I tried to solve it but got this error! can you revise it and

please help to solve this problem using python with dynamic programming!
I tried to solve it but got this error! can you revise it and make sure it gots the correct output!
please help to solve this problem using python with dynamic programming!I tried
to solve it but got this error! can you revise it and
make sure it gots the correct output! C. Snack Attack time limit

C. Snack Attack time limit per test: 1 second 0 memory limit per test: 256 megabytes input: standard input output: standard output Catch popcorn, not boulders! If a boulder hits you, you'll spill some popcorn! (100 points) Snack Attack is a four player minigame in Super Mario Party and you can view how the game is actually played here. The goal of the game is to catch as many kernels of popcorn that fall from the sky using the cups on top of each players' head. In addition to popcorn, boulders will fall from the sky. The boulders are too big to catch with the cup, and so if hit by one, the player will lose half of their current popcorn kernels in the cup. The original game is set in a circular area, but in this problem we will assume it is a square grid for simplicity. If a popcorn kernel falls onto some cell (r,c) at time t and a player is also at the same cell at the same time, this player will get a popcorn kernel. On the other hand, if at time t, a boulder falls onto cell (r,c), this player will lose h/2 popcorn kernels, where h is the current number of popcorn kernels in their cup (e.g., if you now only have 3 popcorn kernels, you will lose 2 and only 1 is left). The players can move at a speed of 1 cell per second and we assume that movement is not affected by any popcorn or boulders. In other words, each second a player can move from the current position to any adjacent cell (on the left, right, top or bottom) or stay at the same location, and they are not slowed down by all of the popcorn nor will they be stunned by a boulder hit. Given the positions of all falling popoorns and boulders, the time that each will fall, and the initial position of the player, we want to know what is the maximum amount of popcorn this player can catch if they play through until the end. Input The first line of the input contains three integers, n(0

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 Databases Questions!