摘要:
题意:给你n个数,要你在这n个数里面找到一些连续的数,这些数的数量大于等于m,并且他们的平均值在这n个数里面是最大的.......思路:先把n个数的最大最小值确定,然后二分枚举平均值,对于每一个连续数,只要他们减去平均值大于0,就调制上限制,不然调整下限制,.......#include#include#includeusing namespace std;double s[100005],sum[100005];int n,m;int deal(double ans){ double f=sum[m-1]-(m-1)*ans; //if(f>-1e-6) //return ... 阅读全文
摘要:
Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.#include#include#includeusing namespace std;double deal(double x){ return 8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*x+6;}int main(){ int t; scanf("%d",&t); while(t 阅读全文