You are not logged in. Please login at www.codechef.com to post your questions!

×

ENIGMA01 - Editorial

PROBLEM LINK:

Guess the Number

Author and Editorialist : Kamini Pandey

DIFFICULTY:

Ad-hoc , Easy

PREREQUISITES:

Sieve of Eratosthenes

PROBLEM:

To guess what is minimum number of questions that are needed to be asked to correctly guess any number in the given range.

EXPLANATION:

The idea is to get the number of primes factor for all the numbers up to K. Firstly lets compute number of primes <= K (This part can be pre computed using Sieve of Eratosthenes ). Then for every prime ‘p’ we need to find highest ‘v’ such that pv <=K.

we add ‘v’ to the answer for each prime.

SOLUTION:

Link to Solution

This question is marked "community wiki".

asked 16 Oct '15, 20:59

sumit.asr_128's gravatar image

2★sumit.asr_128
464
accept rate: 10%

edited 20 Mar '17, 22:25

admin's gravatar image

0★admin ♦♦
19.7k350498541


why Can't he ask in the manner of binary search on v(prime power) ?

link

answered 28 Feb '17, 02:47

durgaprasad726's gravatar image

1★durgaprasad726
11
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×15,482
×3,705
×921
×301
×42

question asked: 16 Oct '15, 20:59

question was seen: 899 times

last updated: 20 Mar '17, 22:25