https://www.acmicpc.net/problem/12789 #include #define endl "\n"using namespace std;void CPP_INIT() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}int main(void) { CPP_INIT(); int input; int num; int s = 1; stack st; cin >> input; for (int i = 0; i > num; if (s != num) { if (!st.empty() && st.top() == num) { st.pop(); s++; } else st.push(num); } else { s++; } } w..