//很容易想到要二分,因此关键是求x^x的位数 //x^x的位数=log10(x^x)+1=x*log10(x)+1 #include <iostream> #include <cmath> using namespace std; int main(){ long long n,l=1,r=2000000000,m; cin>>n; while (l!=r){ m=(l+r)>>1; long long t=m*log10(m)+1; if (t>=n) r=m; else l=m+1; } cout<<l; return 0; }
6
5
2015
5
2015