17298번

· 백준
코드#include #include using namespace std;stack st; // 오큰수를 찾을 스택stack answer; // 정답을 넣어줄 스택int n, a[1000003];void FASTIO() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}int main() { FASTIO(); cin >> n; for (int i = 0; i > a[i]; for (int i = n - 1; i > -1; i--) { // top을 검사하면서 top보다 작은 경우를 탐색 while (st.size()) { int top = st.top(); if (top > a[i]) break; st.pop()..