1.题目的两首歌是啥?
卡在#2了,求助DALAO!
#include<bits/stdc++.h>
using namespace std;
int main(){
int a[3002],b[1002]={0},n,m;
cin>>n>>m;
for(int i = 0;i<n;i++) cin>>a[i];
for(int i = 0;i < n-m+1;i++) for(int j=0;j<m;j++) b[i]+=a[i+j];
sort(b,b+n-m+1);
cout<<b[0];
return 0;
}