×

# Binary Search , How to Crack

 0 1 Problem link : http://www.codechef.com/CDBR2015/problems/CDBSTR1 Every one applying binary Search in the above problem.Can anyone explain me the logic?? How to solve this problem?? asked 12 Feb '15, 02:03 5★n1n1_4 84●4●6●22 accept rate: 50%

 2 In this question the maximum answer can be (smallest +largest)/number of cars packed (it can be less But can never be greater then this) and minimum is 1. So start with a mid value=(max+min)/2. And do binary search . If the result is true increment left and other wise decrement right . Take the maximum of the answer and this will be right then . After doing this, do this one . Uses Binary search .This will help you http://www.iarcs.org.in/inoi/online-study-material/problems/post-election-transfers.php Cheers answered 12 Feb '15, 09:49 131●5 accept rate: 14% thanks @adityakhanna1999 (12 Feb '15, 16:47) n1n1_45★
 0 Welcome , ever ready to help . Thanks for upvote . answered 12 Feb '15, 17:01 131●5 accept rate: 14%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×3,614
×980
×294

question asked: 12 Feb '15, 02:03

question was seen: 874 times

last updated: 12 Feb '15, 17:01