exam.cpp: In function 'void solve()':
exam.cpp:36:25: error: 'stack' was not declared in this scope
36 | map<int, int> cont; stack<int> st;
| ^~~~~
exam.cpp:10:1: note: 'std::stack' is defined in header '<stack>'; did you forget to '#include <stack>'?
9 | #include <iomanip>
+++ |+#include <stack>
10 | using namespace std;
exam.cpp:36:31: error: expected primary-expression before 'int'
36 | map<int, int> cont; stack<int> st;
| ^~~
exam.cpp:38:17: error: 'st' was not declared in this scope; did you mean 'std'?
38 | while (!st.empty() && st.top() <= a[i]) {
| ^~
| std
exam.cpp:40:27: error: 'st' was not declared in this scope; did you mean 'std'?
40 | } cont[a[i]] = i; st.push(a[i]);
| ^~
| std
exam.cpp:43:29: error: 'st' was not declared in this scope; did you mean 'std'?
43 | } cont.clear(); while (!st.empty()) st.pop();
| ^~
| std
exam.cpp:45:17: error: 'st' was not declared in this scope; did you mean 'std'?
45 | while (!st.empty() && st.top() <= a[i]) {
| ^~
| std
exam.cpp:47:27: error: 'st' was not declared in this scope; did you mean 'std'?
47 | } cont[a[i]] = i; st.push(a[i]);
| ^~
| std