为啥全是MLE
#include <bits/stdc++.h>
using namespace std;
int m;
long long a,x;
string c;
deque<int> q[1000000];
int main(){
cin >> m;
for(int i=0;i<m;i++){
cin >> c;
cin >> a;
if(c == "push_back"){
cin >> x;
q[a].push_back(x);
}
if(c == "push_front"){
cin >> x;
q[a].push_front(x);
}
if(c == "size"){
cout << q[a].size() << endl;
}
if(!q[a].empty()){
if(c == "pop_back"){
q[a].pop_back();
}
if(c == "pop_front"){
q[a].pop_front();
}
if(c == "front"){
cout << q[a].front() << endl;
}
if(c == "back"){
cout << q[a].back() << endl;
}
}
}
}