栈和队列模版
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
stack<int> a;
queue<int> b;
int to[N],nxt[N],head[N],rp;
void add_edg(int x,int y){
to[++rp]=y;
nxt[rp]=head[x];
head[x]=rp;
}
int val[N],nex[N],frot[N],hea,tai,cnt;
void lb(int x){
val[++cnt]=x;
frot[cnt]=tai;
nex[tai]=cnt;
tai=cnt;
//front
val[++cnt]=x;
nex[cnt]=hea;
frot[hea]=cnt;
hea=cnt;
//erase
nex[frot[x]]=nex[x];
frot[nex[x]]=frot[x];
}
vector<int> vec;
void vect(){
vec.push_back(1);vec[0]==1;
vec.pop_back();
vec.size();
vec.clear();
vec.front();
vec.back();
}
//STL set map vector hash
vector<int> e[N];
void add_e(int x,int y){
e[x].push_back(y);
}
void find_e(int x){
int siz=e[x].size();
for(int i=0;i<siz;i++){
int y=e[x][i];
}
}
signed main(){
a.push(10);
int aa=a.top();
bool aaa=a.empty();
int as=a.size();
a.pop();
b.push(1);
b.push(2);
int b1=b.front(),b2=b.back();
b.pop();
bool bb=b.empty();
int bs=b.size();
}