有两个正整数,求N!的K进制的位数
#include <bits/stdc++.h> using namespace std; const double eps = 1e-6; const double PI = acos(-1.0); const double e = exp(1.0) ; int main() { long long n,k; while(cin>>n>>k) printf("%.0f\n",floor((log(sqrt(2*1.0*PI*k))+k*log(k*1.0/e))/(log(n)))+1); return 0; }
时间: 2024-10-07 09:24:57