Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
121066 曾煦翔 密钥 C++ 解答错误 80 71 MS 1656 KB 522 2024-01-21 15:04:58

Tests(8/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 = -1; 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 = -1; } for(int i = 1;i <= n - m + 1;i++) cout << b[i]; return 0; }


测评信息: