[백준] 알고리즘 C++ 1874번 - 스택 수열문제
문제 https://www.acmicpc.net/problem/1874 1874번: 스택 수열 1부터 n까지에 수에 대해 차례로 [push, push, push, push, pop, pop, push, push, pop, push, push, pop, pop, pop, pop, pop] 연산을 수행하면 수열 [4, 3, 6, 8, 7, 5, 2, 1]을 얻을 수 있다. www.acmicpc.net 소스코드 #include #include #include #include using namespace std; stack st; vector v; int main() { ios_base::sync_with_stdio(false), cin.tie(NULL); int n,cnt=1; cin >> n; for (in..