解题思路
令:
则:
参考代码
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int q;
cin>>q;
while(q--)
{
ll x;
cin>>x;
ll t=cbrt(x+0.5);
cout<<(x+1)*t-(t*t*t*t+2*t*t*t+t*t)/4<<'\n';
}
return 0;
}