Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

How to solve Hotels problem on Spoj with binary search

Revision en1, by samurai123, 2016-12-23 08:39:25

I have solved the problem [LINK] with sliding window. But in comments, some people mentioned about solving it with binary search. What should be the search function for binary search in the problem? Can that function be made without using concept of sliding window.(http://www.spoj.com/problems/HOTELS/)

Tags spoj, binary seach, sliding window, two pointers

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English samurai123 2016-12-23 08:40:08 76
en1 English samurai123 2016-12-23 08:39:25 358 Initial revision (published)