diff --git a/AcWing/829/829.cpp b/AcWing/829/829.cpp new file mode 100644 index 00000000..36b17e6f --- /dev/null +++ b/AcWing/829/829.cpp @@ -0,0 +1,25 @@ +#include + +using namespace std; + +int m, x; +string op; +queue q; + +int main() { + cin >> m; + while (m--) { + cin >> op; + if (op == "push") { + cin >> x; + q.push(x); + } else if (op == "pop") { + q.pop(); + } else if (op == "empty") { + cout << (q.empty() ? "YES" : "NO") << endl; + } else { + cout << q.front() << endl; + } + } + return 0; +}