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

129/486

Solve/Submission

Ranking

# User Language Timing
01 Tanmoy Cpp 0.00s
02 shamimjucse Cpp 0.00s
03 rohijulislam Cpp 0.00s
04 t0whid Cpp 0.00s
05 Pure_Protea Cpp 0.00s
06 robin_aust Cpp 0.00s
07 akram Cpp 0.00s
08 Ishrak Cpp 0.00s
09 atqrhmn Cpp 0.00s
10 shishir09 Cpp14 0.00s
11 The_Viper Cpp 0.00s
12 Shamim_A Cpp 0.00s
13 Aman_khan Cpp 0.00s
14 deder Cpp 0.00s
15 rayhan50001 Cpp 0.00s
16 badhansen123 Cpp 0.00s
17 subhashis_cse Cpp 0.00s
18 aseem_cu Cpp 0.00s
19 codebreaker007 Cpp 0.00s
20 yakin Cpp 0.00s
21 Trusted_Frustrated Cpp 0.00s
22 mhiceiuk Cpp 0.00s
23 haasib Cpp 0.00s
24 showmic Cpp 0.00s
25 emrul Cpp 0.00s
26 Foysol_Ahmed Cpp 0.00s
27 FahimSifnatul Cpp 0.00s
28 tariqiitju Cpp 0.00s
29 cse_nazmul Cpp 0.00s
30 Saadmaan007 Cpp 0.00s
31 duronto20 Cpp 0.00s
32 I_See_You Cpp 0.00s
33 rajdipsaha Cpp 0.00s
34 yasirnabil534 Cpp 0.00s
35 belal_mbstu Cpp 0.00s
36 xb_saykat Cpp 0.00s
37 mahbub07 Cpp 0.00s
38 afzalul C 0.00s
39 a_rahman Cpp 0.00s
40 onucsecu Cpp 0.00s
41 ashraful_haque Cpp14 0.00s
42 Reayz Cpp 0.00s
43 FariD Cpp14 0.00s
44 Sarwar05 Cpp 0.00s
45 iamsadee Cpp 0.00s
46 feodorv C 0.00s
47 atmfaisal Cpp 0.00s
48 miltonbhowmick Cpp 0.00s
49 AlaminJust Cpp 0.00s
50 Silent_Warrior Cpp 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support