https://www.luogu.org/problemnew/show/P2759
1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 #include<vector> 5 #include<cmath> 6 using namespace std; 7 #define fi first 8 #define se second 9 #define mp make_pair 10 #define pb push_back 11 typedef long long ll; 12 typedef unsigned long long ull; 13 typedef pair<int,int> pii; 14 ll n,l,r; 15 int main() 16 { 17 ll mid; 18 scanf("%lld",&n); 19 l=0;r=2000000000; 20 while(r-l>1) 21 { 22 mid=l+(r-l)/2; 23 if(mid*log10(mid)>=n-1) r=mid; 24 else l=mid; 25 } 26 printf("%lld",r); 27 return 0; 28 }