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

94/468

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support