HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Arithmetic > problem:


50651 - Largest power of two

Guest
• Discussion of problem (1)

Section problems

• 50368 - Right-most non zero digit in N!
• 50293 - Sum of odd numbers from ...
• 50365 - Sum of the numbers from a...
• 50388 - Number of Armstrong Num...
• 50363 - Class GPA Average
• 50390 - Total Salary Paid
• 50392 - How much space
• 50394 - Water Bills
• 50651 - Largest power of two
• 50297 - Divisible By Five
• 50332 - Variance of a series
• 50398 - Sum of kth Anti-diagonal
• 50400 - nth Row rth Element of a Table
• 50330 - Find the average of n numbers
• 50401 - Sum of Odd Numbers
• 50369 - Base Conversion
• 50407 - Missing Number

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan. Difficulty Beta

Write a program which has a function largest2spower. largest2spower function takes a number (n)
and finds the largest power of two whose result is less than or equal to the given number n
(1 <= n <= 4.000.000.000)

Sample Run 1:
Enter a number:1000
Sample Output 1:
9 // 29=512 and 210=1024


Sample Run 2:
Enter a number:100
Sample Output 2:
6 // 26=64 and 27=128
Для отправки решений необходимо выполнить вход.

www.contester.ru