二分 奇怪的函数
問題描述
使得x^x達到或超過n位數字的最小正整數x是多少?
輸入格式
輸入一個正整數n(n<=2000 000 000)。
輸出格式
輸出使得x^x達到n位數字的最小正整數x。
輸入樣例
11輸出樣例
10限制與約定
時間限制:1s
空間限制:128MB
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> using namespace std; int n; int main() {long long r=1000000000,l=1,t;cin>>n;while(l<r){t=(l+r)/2;if(t*log10(t)+1>=n) r=t;else if(t*log10(t)<n) l=t+1;}cout<<r;return 0; }?
轉載于:https://www.cnblogs.com/hfang/p/11239880.html
總結
 
                            
                        - 上一篇: 二分 划分数列
- 下一篇: 河中跳房子(noiopenjudge,n
