Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
180665 C班詹皓杰 密钥 C++ 通过 100 954 MS 256 KB 402 2024-08-21 17:15:53

Tests(10/10):


#include<iostream> #include<queue> using namespace std; struct Node{ int ind,v; }t; deque<Node> q; int main(){ int n,m; cin>>n>>m; for(int T = 1; T <= n; T++){ cin>>t.v; t.ind = T; while(!q.empty() && t.v>=q.back().v){ q.pop_back(); } q.push_back(t); if(T-q.front().ind >= m){ q.pop_front(); } if(T >= m){ cout<<q.front().v; } } return 0; }


测评信息: