제출 #462601

#제출 시각아이디문제언어결과실행 시간메모리
462601JasperLBaloni (COCI15_baloni)C++14
100 / 100
242 ms3864 KiB
#include <iostream>
using namespace std;

#define maxn 1000005

int f[maxn];

int main() {
    int n; cin >> n;
    int ret = 0;
    for (int i = 0; i < n; i++) {
        int h; cin >> h;
        if (f[h+1]) f[h+1]--;
        else ret++;
        f[h]++;
    }
    cout << ret << endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...