3. Magic Ship

Getting Started with Competitive Programming

(an NPTEL course)

Module 3. Magic Ship

This lecture is based on the problem called “Magic Ship” (Codeforces Education Round #60), and you can find a link to it here.

In this problem, we are trying to help a ship reach its destination in some challenging weather! While it becomes clear quickly that you want to binary search on the possibilities for the number of days you need to arrive, the upper bound for the search range is a bit of a mystery at the outset - and fun to figure out.

The code discussed in the video can be found here.

super-embed:<div id="hyvor-talk-view"></div><script async defer type="text/javascript" src="//talk.hyvor.com/web-api/embed.js"></script>