题解 | 小红的函数最大值
小红的函数最大值
https://www.nowcoder.com/practice/ef7f1d579daa4d349abd120a70b708e8
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
//f(x) 是先增后减函数
int a,b;
cin>>a>>b;
double x = 1 / (b*(log(a)));
double res = log(x)/log(a) - b * x;
printf("%.10f\n",res);
return 0;
}
