제출 #899457

#제출 시각아이디문제언어결과실행 시간메모리
899457jocccccaBaloni (COCI15_baloni)C++14
0 / 100
2079 ms11168 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;

 int b[1000000];
signed main()
{
    int n;
    cin >> n;
    int a[n];
    for(int i=0; i < n; i++)cin>>a[i];

    for(int i=0; i < n;i++){
        for(int j=i+1; j < n; j++){
            if(a[i]-1==a[j])b[i]++;
        }
    }

    int rez=0;

    for(int i=0; i < n; i++){
        //cout<<b[i]<< " ";
    }
   // cout<<endl;
    for(int i=0; i < n; i++){
        if(a[i]==1 || b[i]==0)rez++;
    }
    cout<<rez;
}
#Verdict Execution timeMemoryGrader output
Fetching results...