제출 #104304

#제출 시각아이디문제언어결과실행 시간메모리
104304tduong0806Baloni (COCI15_baloni)C++14
100 / 100
227 ms504 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+10;
int n,x,d[N],r;
int main()
{
    cin>>n;
    while(n--)
    {
        cin>>x;
        if(!d[x]) r++,d[x-1]++;
        else d[x]--,d[x-1]++;
    }
    cout<<r;
}
#Verdict Execution timeMemoryGrader output
Fetching results...