백준 10866
[백준 10866번-C++] 덱
http://acmicpc.net/problem/10866 {코드} #include #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, tmp; deque dq; string op; cin >> n; while (n--) { cin >> op; if (op == "push_front") { cin >> tmp; dq.push_front(tmp); } else if (op == "push_back") { cin >> tmp; dq.push_back(tmp); } else if (op == "pop_front") { if (dq.empty()) cout