DCP-330: Power Function Back to All Problems

Easy Beginners Problems > Ad-hoc


Given **x** , print the left-most decimal digit of **f(x)** with sign. if x is a odd number then f(x) = (-1) * ( 2 ^ x ) , Otherwise f(x) = 2 ^ x . **note :** **2 ^ x** means, **xth** power of **2**. Input: ------ Input starts with an integer **T (1<=1000)**, denoting the number of test cases. Each case contains an integer **x (1 ≤ x ≤ 60)** . Output: ------- For each case of input, output the left-most decimal digit of **f(x)**. Sample Input ------------ 3 1 2 10 Sample Output ------------- -2 +4 +1


Problem Setter:

Ashini Singha

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# 1.00
Go 1.00
Java 1.00
JavaScript 1.00
Objective-C 1.00
Perl 1.00
PHP 1.00
Python 1.00
Python3 1.00
Ruby 1.00
VB.Net 1.00

Problem Stats

235/503

Solve/Submission

Ranking

# User Language Timing
01 monkey Cpp14 0.00s
02 cse_nazmul Cpp14 0.00s
03 atik Cpp14 0.00s
04 BishalG C 0.00s
05 anowar1112 Cpp14 0.00s
06 Koushik_12 Cpp14 0.00s
07 ifat_just Cpp14 0.00s
08 inactivecoder Cpp14 0.00s
09 shailyroy Cpp14 0.00s
10 I_Monimul Cpp14 0.00s
11 shawon100 Cpp14 0.00s
12 zitul_mahmud Cpp14 0.00s
13 Gang_Of_Three_01 Cpp14 0.00s
14 Dark_Ocean Cpp14 0.00s
15 murad_al_wajed Cpp14 0.00s
16 ssavi Cpp14 0.00s
17 badhansen123 Cpp14 0.00s
18 Zayed Cpp14 0.00s
19 codebreaker007 Cpp14 0.00s
20 yakin Cpp14 0.00s
21 Nazmul_WUB Cpp14 0.00s
22 pusku Cpp14 0.00s
23 foysal_007 Cpp14 0.00s
24 asad_IT Cpp14 0.00s
25 Shakil_Mahmud Cpp14 0.00s
26 showmic Cpp14 0.00s
27 zyyxxx Cpp14 0.00s
28 Optimus_primeV2 Cpp14 0.00s
29 Linkon_Ruhul Cpp14 0.00s
30 Biprodas Cpp14 0.00s
31 sazal_dev Cpp14 0.00s
32 7Mahfuz Cpp14 0.00s
33 reshan13 Cpp14 0.00s
34 SM_Roknuzzaman Cpp14 0.00s
35 arabin C 0.00s
36 plab0n Cpp14 0.00s
37 shamimjucse Cpp14 0.00s
38 Masum_ice Cpp14 0.00s
39 t0whid Cpp14 0.00s
40 Pure_Protea Cpp14 0.00s
41 maxhasan Cpp14 0.00s
42 saiful130104 Cpp14 0.00s
43 MRITuhin Cpp14 0.00s
44 emrul Cpp14 0.00s
45 prodipdatta7 Cpp14 0.00s
46 milak_yn Cpp14 0.00s
47 Aman_khan Cpp14 0.00s
48 fearless_hasan Cpp14 0.00s
49 joy25896 Cpp14 0.00s
50 wizard Cpp 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support