Problem staircase
User TA
Submission Time 2026-06-24 16:24:37
Score 0
Max Time N/A
Max Memory N/A

Compile Error

staircase.cpp: In function ‘int main()’:
staircase.cpp:7:2: error: ‘vector’ was not declared in this scope
7 | vector<int> blocks;
| ^~~~~~
staircase.cpp:2:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
1 | #include <iostream>
+++ |+#include <vector>
2 | using namespace std;
staircase.cpp:7:9: error: expected primary-expression before ‘int’
7 | vector<int> blocks;
| ^~~
staircase.cpp:11:3: error: ‘blocks’ was not declared in this scope; did you mean ‘clock’?
11 | blocks.push_back(x);
| ^~~~~~
| clock
staircase.cpp:14:19: error: ‘blocks’ was not declared in this scope; did you mean ‘clock’?
14 | for(int j; j<int(blocks.size());j++){
| ^~~~~~
| clock
staircase.cpp:25:6: error: expected ‘;’ before ‘longest’
25 | cout longest;