ログイン
新規登録
AtsuoCoder Waseda Tour Finals 2025
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 905896bf-0932-48e4-8094-936e9a14e970
コード
#include <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> // pow, sqrt #include <iomanip> // setprecision #define int int64_t #define double long double using namespace std; signed main() { //cout << fixed << setprecision(10); deque<int> dq; int q; cin >> q; for (int i = 0; i < q; i++) { int t; cin >> t; if (t == 1) { int x; cin >> x; dq.push_back(x); } else if (t == 2) { int x; cin >> x; dq.push_front(x); } else { cout << dq.front() << endl; dq.pop_front(); } } return 0; }
結果
問題
点数
言語
結果
実行時間
メモリ
E - Q2
100
C++
AC
135 ms
3944 KiB