求数组中前k个元素的最大值
class FRISTQUEUE{
public:
int k;
deque<int>q;
deque<int>id;
void push(int x,int tid){
while(!q.empty()&&q.back()<x){
q.pop_back();
id.pop_back();
}
q.push_back(x);
id.push_back(tid);
if(tid-id.front()>=k){
q.pop_front();
id.pop_front();
}
}
int front(){
return q.front();
}
};