DCP-385: Power Of 5 Back to All Problems

Easy Math > Basic Math


You are given an integer, say **N**, your task is to determine whether this integer can be represented as a non-negative power of **5**. I.e `N= 5^X`,Where **X** is a nonnegative integer number. Input: ------ Input starts with an integer **T (1<=T<=20)**, denoting the number of test cases. Each case contains an integer **N ( N>=0 )** ,which will be in the range of 64 bit signed integer number. Output: ------- For each case of input, output a line with **“YES”** if **N** can be represented as a power of 5 , otherwise print **“NO”** without any quotes. Sample Input ------------ 2 25 20 Sample Output ------------- YES NO


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

134/499

Solve/Submission

Ranking

# User Language Timing
01 Sarwar05 Cpp 0.00s
02 codebreaker007 Cpp 0.00s
03 kzvd4729 Cpp 0.00s
04 Rijwan_Hossain C 0.00s
05 lsiddiqsunny Cpp 0.00s
06 nurshuvo51 Cpp 0.00s
07 Saadmaan007 Cpp 0.00s
08 trifiasco Cpp 0.00s
09 Reayz Cpp 0.00s
10 nasib_mbstu Cpp14 0.00s
11 t0whid Cpp 0.00s
12 akram Cpp 0.00s
13 Trusted_Frustrated Cpp 0.00s
14 alif_biswas Cpp 0.00s
15 rayhan50001 Cpp 0.00s
16 Foysol_Ahmed Cpp 0.00s
17 ainan_ahmed Cpp 0.00s
18 showmic Cpp 0.00s
19 Shamim_A Cpp 0.00s
20 subhashis_cse Cpp 0.00s
21 SakibAlamin Cpp14 0.00s
22 mbstu_alamin16 Cpp 0.00s
23 emrul Cpp 0.00s
24 kissu_pari_na Cpp 0.00s
25 cse_nazmul Cpp 0.00s
26 rohijulislam Cpp 0.00s
27 The_Viper Cpp 0.00s
28 mhiceiuk Cpp 0.00s
29 badhansen123 Cpp 0.00s
30 Tanmoy Cpp 0.00s
31 Snails_AR_Munna Cpp 0.00s
32 haasib Cpp 0.00s
33 ____ Cpp 0.00s
34 atmfaisal Cpp 0.00s
35 Not_Found0001 Cpp 0.00s
36 pito Cpp 0.00s
37 AlaminJust Cpp 0.00s
38 monir769 Cpp 0.00s
39 shamimjucse Cpp 0.00s
40 joymollick Cpp14 0.00s
41 sirpoka C 0.00s
42 yasirnabil534 Cpp 0.00s
43 AAnwar Cpp14 0.00s
44 belal_mbstu Cpp 0.00s
45 iamsadee Cpp 0.00s
46 I_See_You Cpp 0.00s
47 miltonbhowmick Cpp 0.00s
48 yakin Cpp 0.00s
49 robin_aust Cpp 0.00s
50 xb_saykat Cpp 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support