r friends has invented a new game called Pillar Jumpers. In this ga ghts are placed next to each other. The player starts on the first pil J jumps. The player has a certain jump strength S that determin th pillar for i e [1... N]. The player can jump from pillar i to jif ts of the pillars and the maximum number of jumps J, determine layer can still finish the game.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
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 <j <i+S and h; < h; +
Given the heights of the pillars and the maximum number of jumps J, determine the minimum required jump strene
such that the player can still finish the game.
Input format
• Line 1: The integers N and J separated by space (1 < N< 100.000 and 1<J<1.000.000.000).
• Line 2: The heights of the N pillars separated by space (the height is at most 1.000.000.000).
Output format
• Line 1: The minimum required strength S.
Restrictions
You are free to use all built-in modules/packages/functions in the language you choose. You are not allowed to use
other modules/packages/code/etc from the internet or similar.
Hidden01
Ctt
Input (stdin)
21
1 555555555
Output
Error: expected 555555554 but was 555555555
Your Output
Expected Output
1 555555555
555555554
Hidden02
Input (stdin)
2 1
11
Output
Your Output
Exxpected Output
1 1
2
Hidden05
Input (stdin)
1ee s
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
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
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
363 372
Output
Error: expected 77 but was 67
Expected Output
22
Your Output
62
Transcribed Image 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 <j <i+S and h; < h; + Given the heights of the pillars and the maximum number of jumps J, determine the minimum required jump strene such that the player can still finish the game. Input format • Line 1: The integers N and J separated by space (1 < N< 100.000 and 1<J<1.000.000.000). • Line 2: The heights of the N pillars separated by space (the height is at most 1.000.000.000). Output format • Line 1: The minimum required strength S. Restrictions You are free to use all built-in modules/packages/functions in the language you choose. You are not allowed to use other modules/packages/code/etc from the internet or similar. Hidden01 Ctt Input (stdin) 21 1 555555555 Output Error: expected 555555554 but was 555555555 Your Output Expected Output 1 555555555 555555554 Hidden02 Input (stdin) 2 1 11 Output Your Output Exxpected Output 1 1 2 Hidden05 Input (stdin) 1ee s 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 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 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 363 372 Output Error: expected 77 but was 67 Expected Output 22 Your Output 62
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Topological Sort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education