首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
小红的函数最大值
[编程题]小红的函数最大值
热度指数:1151
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 256M,其他语言512M
算法知识视频讲解
小红希望你求出函数
在定义域上的最大值。你能帮帮她吗?
输入描述:
两个正整数
,用空格隔开
输出描述:
该函数在定义域上的最大值。你只需要保证和标准答案的相对误差不超过
即可通过本题。
示例1
输入
2 1
输出
-0.9139286679
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(16)
分享
纠错
提交结果有问题?
2个回答
8篇题解
开通博客
牛客77911743号
发表于 2025-04-27 10:51:47
import sys import math # 定义域为x>0, 先增大后减小, f的导数为0时为最大值 for line in sys.stdin: a,b = map(int,line.strip().split()) x = 1 / (b*math.log(a))
展开全文
牛牛无敌a
发表于 2025-04-01 21:31:08
#include <cmath> #include <iomanip> #include <iostream> using namespace std; // 函数用于计算 log_a(x) double log_base(double x, double ba
展开全文
我很强我知道
发表于 2025-06-05 16:37:09
#include <iostream> #include<cmath> #include<iomanip> using namespace std; int main() { int a, b; while (cin >> a >
展开全文
当时月
发表于 2025-04-16 13:06:45
from math import log def com_max(a, b): x = 1 / (b * log(a)) ans = log(x)/log(a) - b*x return ans def main(): nums = [int(i) for i i
展开全文
牛客967526391号
发表于 2025-04-05 13:52:09
#include <stdio.h> #include <math.h> int main() { double a,b; scanf("%lf %lf",&a,&b); // 手算出最大取值点x // 计算
展开全文
爱吃肉的太平湖水怪在刷代码
发表于 2025-04-03 20:07:31
#include <iostream> #include <cmath> #include <cstdio> using namespace std; int main() { int a, b; cin >> a >> b;
展开全文
Qadccccc
发表于 2025-05-08 14:35:00
import sys import math for line in sys.stdin: nums=list(map(int,line.strip().split())) #print(int(a[0]) + int(a[1])) a= nums[0] b= num
展开全文
Lavada
发表于 2025-05-22 13:45:45
#include <iostream> #include <cmath> #include <cstdio> using namespace std; int main() { //f(x) 是先增后减函数 int a,b; cin>
展开全文
问题信息
来自:
2024年淘天集团春招...
难度:
2条回答
16收藏
445浏览
热门推荐
相关试题
小红的最大中位数
评论
(2)
来自
2024年淘天集团春招算...
在对大模型进行 finetune ...
深度学习
评论
(0)
来自
2024年淘天集团春招算...
在大模型的预训练阶段,选择合适的任...
深度学习
评论
(1)
来自
2024年淘天集团春招算...
在深度学习中,以下哪些因素可能导致...
深度学习
评论
(0)
来自
2024年淘天集团春招算...
在逻辑回归模型中,你注意到模型的预...
机器学习
评论
(0)
来自
2024年淘天集团春招算...
小红的函数最大值
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
2 1
-0.9139286679