Codeforces Educational Codeforces Round 41 (Rated for Div. 2) B. Lecture Sleep

点击打开链接

#include 
#include
#include
using namespace std;
typedef long long LL;
const int maxn=1e5+5;
int a[maxn],t[maxn];
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    LL sum=0;
    for(int i=0;i=0&&!t[i-k]) s-=a[i-k];
         m=max(m,s);
    }
    cout<

你可能感兴趣的:(Codeforces,Codeforces)