Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void)
{
    int N,M;
    cin>>N>>M;
    
    vector<int> breakstair(M);
    int sol[N+1];

    
    for(int i=0;i<M;i++){
        int k;
        cin>>k;
        breakstair.push_back(k);
    }
    
    vector<int>::iterator itr1=find(breakstair.begin(),breakstair.end(),1);
    vector<int>::iterator itr2=find(breakstair.begin(),breakstair.end(),2);
    
    if(itr1!=breakstair.end()) {
        sol[1]=0;
        if(itr2!=breakstair.end()){
            sol[2]=0;
        }
        else{
            sol[2]=1;
        }
    }
    else if(itr2!=breakstair.end()){
        sol[1]=1;
        sol[2]=0;
    }
    else{
        sol[1]=1;
        sol[2]=2;
    }
    
    
    
    for(int i=3;i<=N;i++){
        vector<int>::iterator itri=find(breakstair.begin(),breakstair.end(),i);
        if(itri!=breakstair.end()){
            sol[i]=0;
        }
        else{
            sol[i]=(sol[i-1]+sol[i-2])%1000000007;
        }
    }
    
    cout<<sol[N]<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:36: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
   23 |     vector<int>::iterator itr1=find(breakstair.begin(),breakstair.end(),1);
      |                                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:23:36: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   23 |     vector<int>::iterator itr1=find(breakstair.begin(),breakstair.end(),1);
      |                                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:36: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
   24 |     vector<int>::iterator itr2=find(breakstair.begin(),breakstair.end(),2);
      |                                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:24:36: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   24 |     vector<int>::iterator itr2=find(breakstair.begin(),breakstair.end(),2);
      |                                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:47:40: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   47 |         vector<int>::iterator itri=find(breakstair.begin(),breakstair.end(),i);
      |                                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:47:40: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   47 |         vector<int>::iterator itri=find(breakstair.begin(),breakstair.end(),i);
      |                                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~