题意:
解法:
设f(x)=x^5
f(n)-f(n-1)>1e9,
n不需要太大就能满足条件(几百就够了),
因此直接[-200,200]枚举A和B即可.
code:
#include<bits/stdc++.h>
#define int long long
#define PI pair<int,int>
using namespace std;
const int maxm=2e6+5;
int f(int x){
return x*x*x*x*x;
}
void solve(){
int x;cin>>x;
for(int i=-200;i<=200;i++){
for(int j=-200;j<=200;j++){
if(f(i)-f(j)==x){
cout<<i<<' '<<j<<endl;
return ;
}
}
}
}
signed main(){
solve();
return 0;
}