DCP-553: Perfect Numbers Back to All Problems

Medium Beginners Problems > Implementation


We know, a **perfect square** is a number that can be expressed as the product of two equal integers, a **perfect cube** is a number that can be expressed as the product of three equal integers and a **perfect quartic** is a number that can be expressed as the product of four equal integers. A **perfect number** is the number which is perfect square, perfect cube and perfect quartic. You are given a range, find how many perfect numbers lies in the given range. Input: ------ Input starts with an integer T, denoting the number of test cases. Each test case contains **two** integers L, R denoting a range. Constraints 1 &le; T &le; 100000 1 &le; L &le; R &le; 10<sup>18</sup> Output: ------- For each test case, print required answer. Sample Input ------------ 3 1 10 1 100 2 1000 Sample Output ------------- 1 1 0


Problem Setter:

Bir Bahadur Khatri

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

89/457

Solve/Submission

Ranking

# User Language Timing
01 Sarwar05 Cpp 0.02s
02 sirpoka Cpp14 0.03s
03 pulak_ict_mbstu Cpp14 0.04s
04 emrul Cpp14 0.05s
05 Pure_Protea Cpp14 0.05s
06 sajjad_h Cpp 0.05s
07 ssavi Cpp 0.05s
08 FahimSifnatul Cpp 0.05s
09 mohibur Cpp14 0.05s
10 Bruteforcekid Cpp14 0.05s
11 tlcakash Cpp 0.05s
12 kabbya Cpp 0.05s
13 Frdhsn Cpp14 0.06s
14 feodorv C 0.06s
15 anikatahsin Cpp 0.06s
16 Brokenlog Cpp 0.06s
17 wajiul Cpp 0.06s
18 hmsayem Cpp 0.07s
19 subhashis_cse Cpp 0.07s
20 fayedanik Cpp 0.07s
21 monir769 Cpp14 0.07s
22 mamun02inf Cpp14 0.08s
23 theintelligentboy C 0.08s
24 prodipdatta7 Cpp14 0.08s
25 Arnob114348 Cpp 0.08s
26 Tasmim Cpp14 0.10s
27 mhiceiu Cpp 0.12s
28 Ron6164 Cpp 0.12s
29 mhiceiuk Cpp 0.13s
30 _c_k_r_ Cpp 0.16s
31 Shahriar_88 Cpp14 0.16s
32 aaman007 Cpp14 0.16s
33 Rajan_sust Cpp 0.16s
34 SakibAlamin Cpp14 0.17s
35 rayhan50001 Cpp 0.17s
36 tahsin_protik Cpp 0.17s
37 NirobSUST Cpp 0.20s
38 duronto20 Cpp 0.20s
39 Ayesha_Sultana Cpp 0.20s
40 sharifulalam Cpp 0.21s
41 badhansen123 Cpp 0.21s
42 aminul116 Cpp 0.21s
43 st3inum Cpp14 0.21s
44 shakil2021 Cpp 0.21s
45 bondhansarker Cpp 0.22s
46 The_Viper Cpp 0.23s
47 heheh Cpp 0.24s
48 mahbubcseju Cpp 0.24s
49 a_rahman Cpp 0.35s
50 Mhkhaled Cpp 0.36s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support