题目链接:
huangjing
题目:
思路:
给出的是一个方程,首先讨论最高项系数。
1:a==0&& b==0 那么函数就是线性的,直接比较端点即可。
2 a==0&&b!=0 那么函数就是二次函数,直接算出特征值,然后比较端点值即可。。
3 a!=0 又有几种情况,那么当特征根 b*b-4*a*c<0 时 说明愿函数是单调,直接比较端点值即可。。
当大于0的时候,直接求出两个根,然后和端点值比较即可
ps:所有的特征根都要是有效的,即都要在[L,R]之间。。
题目:
Math Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 943 Accepted Submission(s): 250
Problem Description Here has an function:
Please figure out the maximum result of f(x).
Input Multiple test cases(less than 100). For each test case, there will be only 1 line contains 6 numbers a, b, c, d, L and R.
Output For each test case, print the answer that was rounded to 2 digits after decimal point in 1 line.
Sample Input
1.00 2.00 3.00 4.00 5.00 6.00
Sample Output
310.00
Source BestCoder Round #18
Recommend heyang | We have carefully selected several similar problems for you: 5106 5103 5102 5101 5100
代码:
#include#include #include #include #include