测试点:AC TLE TLE TLE TLE TLE AC AC AC AC AC TLE TLE TLE
同志,求助!感谢帮助者。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int c[a];
for(int A=0;A<a;A++)
{
cin>>c[A];
}
double e=-1;
int f,g;
for(int A=0;A<=a-b;A++)
{
for(int B=b-1;B<a-A;B++)
{
f=0;
for(int C=A;C<=A+B;C++)
{
f+=c[C];
}
if(double(f)/double(B+1)>e)
{
e=double(f)/double(B+1);
}
}
}
e*=1000;
cout<<int(e);
}
再次感谢!