50 lines
609 B
C++
50 lines
609 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int N_MAX = 1e9;
|
|
|
|
|
|
void test_case(int tc){
|
|
int n;
|
|
cin >> n;
|
|
|
|
set<int> valids;
|
|
int i = 1;
|
|
int r = pow(i, 2);
|
|
while(r <= n){
|
|
valids.insert(r);
|
|
|
|
i++;
|
|
r = pow(i, 2);
|
|
}
|
|
|
|
i = 1;
|
|
r = pow(i, 3);
|
|
while(r <= n){
|
|
valids.insert(r);
|
|
|
|
i++;
|
|
r = pow(i, 3);
|
|
}
|
|
|
|
cout << valids.size() << '\n';
|
|
}
|
|
|
|
|
|
|
|
int main(){
|
|
ios::sync_with_stdio(0);
|
|
cin.tie(0);
|
|
|
|
int t;
|
|
cin >> t;
|
|
|
|
for(int tc = 1; tc <= t; ++tc){
|
|
test_case(tc);
|
|
}
|
|
|
|
cout << flush;
|
|
|
|
return 0;
|
|
} |