提交时间:2024-08-21 16:41:27

运行 ID: 180631

#include <iostream> using namespace std; int n,m,t=0,a[100000],b[100000]; int main() { cin>>n>>m; for (int i=1;i<=n;++i) cin>>a[i]; for (int i=1;i<=n-m+1;++i) { ++t; int mx=-1; for (int j=i;j<=i+m-1;++j) mx=max(a[j],mx); b[t]=mx; } for (int i=1;i<=t;++i) cout<<b[i]; return 0; }