답안 #383753

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
383753 2021-03-30T19:06:21 Z Alma Baloni (COCI15_baloni) C++14
40 / 100
3 ms 1900 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int n, h, t = 0;
    vector<stack<int>> vs(1e3+2, stack<int>());
    cin >> n;
    while (n--) {
        cin >> h;
        if (vs[h+1].empty())
            t++;
        else
            vs[h+1].pop();
        vs[h].push(h);
    }
    cout << t << '\n';
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1004 KB Output is correct
2 Correct 2 ms 1004 KB Output is correct
3 Correct 2 ms 1004 KB Output is correct
4 Correct 2 ms 1004 KB Output is correct
5 Runtime error 3 ms 1900 KB Execution killed with signal 11
6 Runtime error 3 ms 1900 KB Execution killed with signal 11
7 Runtime error 3 ms 1900 KB Execution killed with signal 11
8 Runtime error 3 ms 1900 KB Execution killed with signal 11
9 Runtime error 3 ms 1900 KB Execution killed with signal 11
10 Runtime error 3 ms 1900 KB Execution killed with signal 11