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 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

96/480

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 kabbya Cpp 0.05s
06 Bruteforcekid Cpp14 0.05s
07 ssavi Cpp 0.05s
08 tlcakash Cpp 0.05s
10 FahimSifnatul Cpp 0.05s
11 Pure_Protea Cpp14 0.05s
12 mohibur Cpp14 0.05s
13 emrul Cpp14 0.05s
14 feodorv C 0.06s
15 anikatahsin Cpp 0.06s
16 Frdhsn Cpp14 0.06s
17 wajiul Cpp 0.06s
18 Brokenlog Cpp 0.06s
19 monir769 Cpp14 0.07s
20 subhashis_cse Cpp 0.07s
21 fayedanik Cpp 0.07s
22 hmsayem Cpp 0.07s
23 prodipdatta7 Cpp14 0.08s
24 mamun02inf Cpp14 0.08s
25 Arnob114348 Cpp 0.08s
26 theintelligentboy C 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 Shahriar_88 Cpp14 0.16s
34 Rajan_sust Cpp 0.16s
35 SIFAT_EwU Cpp14 0.16s
36 tahsin_protik Cpp 0.17s
37 rayhan50001 Cpp 0.17s
38 SakibAlamin Cpp14 0.17s
39 NirobSUST Cpp 0.20s
40 Ayesha_Sultana Cpp 0.20s
41 duronto20 Cpp 0.20s
42 st3inum Cpp14 0.21s
43 shakil2021 Cpp 0.21s