← All problemsSign in

E - Guess the Number

CodeChefRating 2928Open on judge ↗

Chef has a sorted array $A$ of size $N$ consisting of $distinct$ elements which you $\text{don’t know}.$ You will be provided with an integer $X$. You have to check whether $X$ exists in Chef's array or not. If it exists, find out at which index it exists. You can ask just $\text{one}$ type of query as follows $:$- You can ask at-most $q$ such queries. If you ask a question for an index say $m$,

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start