Erase The Powers
All submissions for this problem are available.
Problem description : Raghu gives Rannvijay a task.There are infinite number of members in Rannvijay,s Team. He also has a blackboard.He write N natural numbers on a blackboard. His first team member come and erase all the numbers which are squares of a natural number.Then, 2nd one comes and erase all the cubes.The 3rd one erase all the fourth power of numbers and so on. Both of them are watching this. Rannvijay wants Raghu to tell him the number of his teammates that will get a chance to erase a number.But Raghu wants you to help him.So, go ahead.
- 1<=T<= 10.
- The first line contains a single positive integer T , the number of test cases. T Each test cases consists of following:
- First line contains L i.e. the length of number N i.e. the number of digits in it.
- As Ncan be as large as 10^1024 we will enter it in array digit by digit
- For each test case, output a single line containing the answer for the corresponding test case....".
Input: 3 1 2 1 9 10 2 3 0 3 2 5 1 7 9 2 Output: 1 2 11 Explanation In the first test case :1 and 2 are written on board.As 1 is perfect square so ans is 1.
|Time Limit:||0.5 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.