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

92/263

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support