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:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.5, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.