提交时间:2024-04-06 10:49:50

运行 ID: 141760

#include <iostream> #include <queue> using namespace std; int a[100100]; int main() { int n, m, cur = 0; cin >> n >> m; for(int i = 1; i <= n; i++) cin >> a[i]; for(int i = 1; i <= n - m + 1; i++) { int maxn = -1; for(int j = i; j <= i + m - 1; j++) maxn = max(maxn, a[j]); cout << maxn; } cout << endl; return 0; }