DCP-386: Lucky Number Back to All Problems

Medium Math > Basic Math


An integer number N is a lucky number if it is neither a square nor a cube of any integer number. Given two integer value A and B where A≤B. How many numbers are between them which are lucky numbers.<br> For example: if A = 1 and B = 10 then answer will be 6 because the lucky numbers are 2,3,5,6,7 and 10. Input: ------ Input starts with an integer **T (1≤T≤400000)**, denoting the number of test cases. Each case contains two integer A and B. where 1≤A,B≤10^18 and A≤B. Output: ------- For each case of input, output the total count of lucky numbers in a single line. Sample Input ------------ 1 1 10 Sample Output ------------- 6


Problem Setter:

Suman Bhadra

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

55/564

Solve/Submission

Ranking

# User Language Timing
01 emotionless Cpp14 0.28s
02 yasirnabil534 Cpp 0.31s
03 Chayti_Saha98 Cpp 0.31s
04 sayedgkm Cpp 0.32s
05 daihan_mbstu Cpp 0.33s
06 mepromee Cpp 0.33s
07 Jisancse Cpp14 0.33s
08 feodorv Cpp 0.34s
09 mohibur Cpp14 0.38s
10 shamimjucse Cpp 0.40s
11 mahbubcseju Cpp 0.41s
12 Bruteforcekid Cpp 0.42s
13 Shahriar_88 Cpp14 0.43s
14 tariqiitju Cpp 0.46s
15 sahedsohel Cpp 0.47s
16 Mahim007 Cpp14 0.50s
17 subhashis_cse Cpp 0.62s
18 fsshakkhor Cpp 0.62s
19 pantho Cpp 0.63s
20 Rajan_sust Cpp 0.64s
21 skmonir Cpp 0.64s
22 kisu_pari_na Cpp14 0.64s
23 pulak_ict_mbstu Cpp14 0.66s
24 ssavi Cpp 0.67s
25 SakibAlamin Cpp 0.67s
26 prodipdatta7 Cpp14 0.68s
27 joty_ict Cpp 0.70s
28 shafinalam Cpp 0.76s
29 arman_ferdous Cpp 0.77s
30 rajdipsaha C 0.77s
31 Sakhawat_CoU Cpp 0.83s
32 ehsan_sshuvo96 Cpp 0.85s
33 ksohan Cpp 0.88s
34 imAnik Cpp 0.94s
35 kzvd4729 Cpp14 0.94s
36 prateepm Cpp14 0.98s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support