2493

    [골5] 2493 - 탑

    #include #include #define y first #define x second using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL), cout.tie(NULL); int n; cin >> n; stack s; for (int i = 1; i > h; while (!s.empty()) { if (s.top().x > h) { cout