Josefine and her friends has invented a new game called Pillar Jumpers. In this game, a sequence of N pillars of non decreasing heights are placed next to each other. The player starts on the first...


Josefine and her friends has invented a new game called Pillar Jumpers. In this game, a sequence of N pillars of non<br>decreasing heights are placed next to each other. The player starts on the first pillar, and the target is to reach the la<br>pillar in at most J jumps. The player has a certain jump strength S that determines how far he can jump. Let h; be t<br>height of the i'th pillar for i e [1...N). The player can jump from pillar i to j iff. i <j <i+S and h; < h; +<br>Given the heights of the pillars and the maximum number of jumps J, determine the minimum required jump strene<br>such that the player can still finish the game.<br>Input format<br>• Line 1: The integers N and J separated by space (1 < N< 100.000 and 1<J<1.000.000.000).<br>• Line 2: The heights of the N pillars separated by space (the height is at most 1.000.000.000).<br>Output format<br>• Line 1: The minimum required strength S.<br>Restrictions<br>You are free to use all built-in modules/packages/functions in the language you choose. You are not allowed to use<br>other modules/packages/code/etc from the internet or similar.<br>Hidden01<br>Ctt<br>Input (stdin)<br>21<br>1 555555555<br>Output<br>Error: expected 555555554 but was 555555555<br>Your Output<br>Expected Output<br>1 555555555<br>555555554<br>Hidden02<br>Input (stdin)<br>2 1<br>11<br>Output<br>Your Output<br>Exxpected Output<br>1 1<br>2<br>Hidden05<br>Input (stdin)<br>1ee s<br>1789 14 15 17 24 29 3e 37 39 41 46 49 52 54 59 59 67 72 75 76 76 83 91 96 95 1e3 184 113 119 124 125 125 128 133 141<br>141 146 154 161 164 165 165 165 172 178 179 181 188 19e 196 197 197 2e3 208 288 212 219 225 227 227 230 232 232 239 239<br>243 243 250 254 259 263 263 271 271 271 271 277 277 286 295 299 302 388 308 311 312 316 323 328 332 334 343 348 355 355<br>363 372<br>Output<br>Error: expected 77 but was 67<br>Expected Output<br>22<br>Your Output<br>62<br>

Extracted text: Josefine and her friends has invented a new game called Pillar Jumpers. In this game, a sequence of N pillars of non decreasing heights are placed next to each other. The player starts on the first pillar, and the target is to reach the la pillar in at most J jumps. The player has a certain jump strength S that determines how far he can jump. Let h; be t height of the i'th pillar for i e [1...N). The player can jump from pillar i to j iff. i
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here