Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
121071 曾煦翔 密钥 C++ 通过 100 86 MS 1660 KB 526 2024-01-21 15:05:30

Tests(10/10):


#include <bits/stdc++.h> using namespace std; #define int long long const int N = 9 * 1e4 + 10; int a[N]; int b[N]; signed main() { int n , m; cin >> n >> m; int maxn = -1e9; for(int i = 1;i <= n;i++) cin >> a[i]; if(m == 1) { for(int i = 1;i <= n;i++) cout << a[i]; return 0; } for(int i = 1;i <= n - m + 1;i++) { for(int j = 1;j <= m;j++) maxn = max(maxn , a[i + j - 1]); b[i] = maxn; maxn = -1e9; } for(int i = 1;i <= n - m + 1;i++) cout << b[i]; return 0; }


测评信息: