제출 #899027

#제출 시각아이디문제언어결과실행 시간메모리
89902712345678Baloni (COCI15_baloni)C++17
100 / 100
47 ms4040 KiB
#include <bits/stdc++.h>

using namespace std;

const int nx=1e6+5;
int n, x, dp[nx], ans;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>n;
    for (int i=1; i<=n; i++)
    {
        cin>>x;
        if (dp[x+1]) dp[x+1]--, dp[x]++;
        else dp[x]++, ans++;
    }
    cout<<ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...