CF1619B.Squares and Cubes
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Polycarp likes squares and cubes of positive integers. Here is the beginning of the sequence of numbers he likes: 1 , 4 , 8 , 9 , ....
For a given number n , count the number of integers from 1 to n that Polycarp likes. In other words, find the number of such x that x is a square of a positive integer number or a cube of a positive integer number (or both a square and a cube simultaneously).
输入格式
The first line contains an integer t ( 1≤t≤20 ) — the number of test cases.
Then t lines contain the test cases, one per line. Each of the lines contains one integer n ( 1≤n≤109 ).
输出格式
For each test case, print the answer you are looking for — the number of integers from 1 to n that Polycarp likes.
输入输出样例
输入#1
6 10 1 25 1000000000 999999999 500000000
输出#1
4 1 6 32591 32590 23125