这道题如果要解出来的话,除了要想到二分,更要想到枚举区间段为1的各部分,然后再注意注意细节就差不多了。 #include<bits/stdc++.h> using namespace std; double a,b,c,d; int ans=0; inline double f(double x)//定义好求值的函数 { return a*x*x*x+b*x*x+c*x+d; } int main() { scanf("%lf %lf %lf %lf",&a,&b,&c,&d); for(double i=-100;i<...