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

Your feedback is our precious!



Or call +88 02 9853138 for support