Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
120664 | 梁乃元 | 密钥 | C++ | 解答错误 | 0 | 174 MS | 260 KB | 540 | 2024-01-20 20:32:06 |
# include <bits/stdc++.h> using namespace std ; queue <int> nums ; int mx ( queue <int> x ) { int mxn = 0 ; while ( ! x . empty ( ) ) { mxn = max ( mxn , x . front ( ) ) ; x . pop ( ) ; } return mxn ; } int main ( ) { int n , m , ans = 0 ; cin >> n >> m ; for ( int i = 1 ; i <= n ; i ++ ) { int x ; cin >> x ; if ( i > m ) { ans *= 10 ; ans += mx ( nums ) ; nums . pop ( ) ; } nums . push ( x ) ; } ans *= 10 ; ans += mx ( nums ) ; cout << ans << endl ; return 0 ; }