https://www.acmicpc.net/problem/17952 코드#include #include using namespace std;#define FASTIO ios::sync_with_stdio(false);cin.tie(NULL);typedef long long ll;stack> st;int main() { FASTIO; int n, a, t, order; ll ans = 0; cin >> n; while (n--) { cin >> order; if (order == 1) { cin >> a >> t; if (t == 1) ans += a; else st.push({ a, t-1 }); } else { if (!st.empty()) { st.top().second-..