ログイン
新規登録
AtsuoCoder Waseda Tour Finals 2025
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 3d490af9-04b2-490f-997a-75ac6e11d026
コード
#include<bits/stdc++.h> using namespace std; using ll=long long; const ll inf=1e18; int main(){ int q,t,x; cin>>q; assert(1<=q&&q<=100000); deque<int>deq; for(int i=0;i<q;i++){ cin>>t; assert(1<=t&&t<=3); if(t==1){ cin>>x; assert(1<=x&&x<=1000000000); deq.push_back(x); } if(t==2){ cin>>x; assert(1<=x&&x<=1000000000); deq.push_front(x); } if(t==3){ assert(deq.size()>=1); cout<<deq.front()<<endl; deq.pop_front(); } } }
結果
問題
点数
言語
結果
実行時間
メモリ
E - Q2
100
C++
AC
102 ms
3916 KiB