Skip to content

Commit ecb69e5

Browse files
committed
add new test
1 parent 7a214a5 commit ecb69e5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#define PROBLEM "https://judge.yosupo.jp/problem/deque"
2+
#include "../template.hpp"
3+
#include "../../../library/data_structures/uncommon/deque_op.hpp"
4+
int main() {
5+
cin.tie(0)->sync_with_stdio(0);
6+
int q;
7+
cin >> q;
8+
deq dq(vector<int>(),
9+
[](int x, int y) -> int { return min(x, y); });
10+
while (q--) {
11+
int type;
12+
cin >> type;
13+
if (type == 0) {
14+
int x;
15+
cin >> x;
16+
dq.push_front(x);
17+
} else if (type == 1) {
18+
int x;
19+
cin >> x;
20+
dq.push_back(x);
21+
} else if (type == 2) {
22+
dq.pop_front();
23+
} else if (type == 3) {
24+
dq.pop_back();
25+
} else {
26+
int i;
27+
cin >> i;
28+
cout << dq[i] << '\n';
29+
}
30+
}
31+
return 0;
32+
}

0 commit comments

Comments
 (0)