Problem brick
User xiaocai918
Submission Time 2026-08-16 10:20:12
Score 0
Max Time N/A
Max Memory N/A

Compile Error

brick.cpp: In function ‘int main()’:
brick.cpp:12:2: error: ‘stack’ was not declared in this scope
12 | stack<int> s;
| ^~~~~
brick.cpp:3:1: note: ‘std::stack’ is defined in header ‘<stack>’; did you forget to ‘#include <stack>’?
2 | #include <vector>
+++ |+#include <stack>
3 | using namespace std;
brick.cpp:12:8: error: expected primary-expression before ‘int’
12 | stack<int> s;
| ^~~
brick.cpp:18:10: error: ‘s’ was not declared in this scope
18 | while (!s.empty() && s.top()) {
| ^
brick.cpp:22:2: error: ‘s’ was not declared in this scope
22 | s.push(x);
| ^
brick.cpp:26:10: error: ‘s’ was not declared in this scope
26 | while (!s.empty()) {
| ^