DCP-566: Cutter of Binary Number Back to All Problems

Medium Math > Basic Math


You are given an integer number **N** and two position **A** and **B**.. Your task is to find the number that is formed by the bit-string of **N** from **A** to **B** (inclusive) position and print its decimal value. Here all position are considered **Right to Left** justified and numbering from 1. For example: N = 366 and A = 3 ,B = 5. the binary representation of N is 0001 0110 1110. Here 3 to 5 position from right to left is 011 and its decimal value is 3. Input: ------ Input starts with an integer **T (1<=100)**, denoting the number of test cases. Each case contains three integer **N (0 ≤ N ≤ 10^8)** , **A and B (1 ≤ A < B ≤32 )** Output: ------- For each case of input, output the Decimal value of A to B position of the bit-string N. Sample Input ------------ 2 366 3 5 145 3 5 Sample Output ------------- 3 4


Problem Setter:

Mohibur Rahman

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

89/259

Solve/Submission

Ranking

# User Language Timing
01 loop_breaker Cpp 0.00s
02 Roki_Moulik_12_EWU Cpp14 0.00s
03 emrul Cpp 0.00s
04 mobasshir Cpp14 0.00s
05 kashem1993 Cpp 0.00s
06 MamunAmin Cpp 0.00s
07 maf_uu Cpp 0.00s
08 sajjad_h Cpp 0.00s
09 The_Viper Cpp 0.00s
10 Raka143 Cpp 0.00s
11 a_rahman Cpp 0.00s
12 BlurryFace Cpp 0.00s
13 Arif_Shariar Cpp 0.00s
14 Riad_IIT7 Cpp 0.00s
15 JubayerSohel Cpp 0.00s
16 sirpoka Cpp14 0.00s
17 porag_ict Cpp 0.00s
18 hrOarr Cpp 0.00s
19 DynamicOvi Cpp 0.00s
20 aaman007 Cpp 0.00s
21 Bisnu039 Cpp 0.00s
22 Ataur Cpp 0.00s
23 joymollick Cpp 0.00s
24 mamun02inf Cpp14 0.00s
25 morol Cpp14 0.00s
26 TarikulCSE Cpp 0.00s
27 muradhossen Cpp 0.00s
28 sitaula Cpp 0.00s
29 SAIF_IIT8_JU Cpp 0.00s
30 Faizul_BU Cpp 0.00s
31 mash02 Cpp 0.00s
32 nill98 Cpp14 0.00s
33 st3inum Cpp 0.00s
34 pencil Cpp 0.00s
35 afridi13 Cpp 0.00s
36 rhprince06 Cpp14 0.00s
37 sourav_malo Cpp 0.00s
38 HurayraIIT Cpp 0.00s
39 rfnamd_ju Cpp 0.00s
40 armancse4 Cpp 0.00s
41 badassiumoxide Cpp 0.00s
42 HunterBoy Cpp14 0.00s
43 Robin008 Cpp 0.00s
44 Tajmin_Mime Cpp 0.00s
45 SMunira Cpp 0.00s
46 shubha_biswas Cpp14 0.00s
47 Bruteforcekid Cpp14 0.00s
48 Farhan_mahbub Cpp 0.00s
49 Arnob114348 Cpp 0.00s
50 m3h3d1 Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support