DCP-374: Bit Need Back to All Problems

Easy Beginners Problems > Ad-hoc


You have given an integer number , you have to find the ***minimum total number of bits*** needed to represent it in binary number system.<br> For example, integer 7 is represented in binary form as : 111 So, it needs minimum 3 bits to represent it. Input: ------ Input starts with an integer **T ( 1<=T<=200000 )**, denoting the number of test cases. Each case contains an integer **N (0 ≤ N ≤ 10^18)** denoting the number. Output: ------- For each case of input, output the minimum number of bits needed to represent that number in binary format. Sample Input ------------ 2 1 7 Sample Output ------------- 1 3 Explanation: For case 1: Integer 1 can be represented in binary number as "0001" ,"01", "1" and so on.But, to represent 1 as "1", only 1 bit is needed, which is minimum. so answer is 1.


Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

184/530

Solve/Submission

Ranking

# User Language Timing
01 FariD Cpp14 0.02s
02 I_See_You Cpp 0.03s
03 Morass Cpp14 0.03s
04 marineCoder Cpp 0.05s
05 saiful130104 Cpp 0.05s
06 atqrhmn Cpp 0.05s
07 cse_nazmul Cpp 0.05s
08 Gang_Of_Three_01 Cpp 0.05s
09 Saimum_140128 Cpp 0.05s
10 haasib Cpp 0.05s
11 tariqiitju Cpp 0.05s
12 Sarwar05 Cpp 0.05s
13 feodorv C 0.05s
14 jualahmed Cpp 0.05s
15 ss1230 Cpp 0.05s
16 jayed_al_hasan Cpp 0.05s
17 ammasum Cpp 0.05s
18 ainan_ahmed Cpp14 0.05s
19 trifiasco Cpp 0.05s
20 SakibAlamin Cpp14 0.05s
21 Mahadi024 Cpp14 0.05s
22 nasib_mbstu Cpp 0.05s
23 tlcakash Cpp 0.05s
24 isakib Cpp 0.05s
25 mh755628 C 0.05s
26 iridescentAurora131 Cpp 0.05s
27 souravahmed C 0.06s
28 iammarajul C 0.06s
29 Bisnu039 C 0.06s
30 kissu_pari_na Cpp 0.06s
31 Akram_H_RIckon C 0.06s
32 haliban_25 C 0.06s
33 CrackerJack Cpp 0.06s
34 nurul_islam Cpp 0.06s
35 anik_JU Cpp 0.06s
36 arabin C 0.06s
37 t0whid Cpp 0.06s
38 Nazmul_WUB Cpp 0.06s
39 ssavi Cpp 0.06s
40 subhashis_cse Cpp 0.06s
41 zitul_mahmud Cpp 0.06s
42 robin_aust Cpp 0.06s
43 shishir09 Cpp14 0.06s
44 Aman_khan Cpp 0.06s
45 afzalul C 0.06s
46 Logic_Hunter Cpp 0.06s
47 pulak_ict_mbstu Cpp 0.06s
48 yakin Cpp 0.07s
49 FahimSifnatul Cpp 0.07s
50 sazal_dev Cpp 0.07s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support