×

# how to solve this problem

 0 https://www.codechef.com/problems/BONDFOND Can anyone explain with the help of an example asked 05 Dec '17, 21:47 66●7 accept rate: 0%

 2 The question asks for the minimum absolute difference between a number N and a number A, which is actually a power of 2. Since the minimum difference has been asked, it is obvious that A is the closest number to N that is a power of 2. Do not forget that the number A could be either less than, greater than or even equal to N. For example, if N=5, the nearest power of 2 is 4. For N=3, the nearest powers of 2 are 2 and 4. For N=8, the nearest power of 2 is 8 itself. For N=9, the nearest power of 2 is 8. answered 05 Dec '17, 23:47 58●5 accept rate: 0%
 0 First of all, what is your doubt? you didn't get any idea to solve this question or you don't understand the question? answered 05 Dec '17, 21:50 1.7k●2●10 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:

×1,116

question asked: 05 Dec '17, 21:47

question was seen: 271 times

last updated: 05 Dec '17, 23:47