Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
ll power(const ll p,const int n)
{
  if(n==0){return 1;}
  if(n%2==1){power(p,n-1)*p%MOD;}
  else{const ll pp =power(p,n/2);
  return pp*pp%MOD;}
}
  
int main()
{
  int N,A,B,C,D;
  cin>>N>>A>>B>>C>>D;
  vector<ll> fact(N+1,1);
  vector<ll> inv(N+1,1);
  vector<ll> invfact(N+1,1);
  for(int i =2;i<=N;i++){
    fact[i]=fact[i-1]*i%MOD;
    inv[i]=power(i,MOD-2);
    invfact[i]=invfact[i-1]*inv[i]%MOD;
  }
  auto=get(const int i,const int l){
    return fact[i]*invfact[i-l]%MOD;
  };
  vector<ll> dp(N+1,0)
  dp[0]=1;
  for(int i = A; i <= B; i++){
    auto tmp = dp;
    for(int j = 0; j <=N; j++){
      if(dp[j] == 0){continue;}
      ll mul=1;
      ll di=1;
      for(int k = C;k <= D; k++){
        const ll rest =N-j-k*i;
        if(rest<0){break;}
        (mul*=get(rest,i))%=MOD;
        (di*=inv[k-C+1])%=MOD;
        (tmp[j+k*i]+=mul*di%MOD)%=MOD;
      }
    }
    dp=tmp;
  }
  cout << dp[N]<< endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: expected unqualified-id before '=' token
   26 |   auto=get(const int i,const int l){
      |       ^
a.cc:30:3: error: expected ',' or ';' before 'dp'
   30 |   dp[0]=1;
      |   ^~
a.cc:40:18: error: no matching function for call to 'get(const ll&, int&)'
   40 |         (mul*=get(rest,i))%=MOD;
      |               ~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1250:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)'
 1250 |     get(pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1250:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1255:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)'
 1255 |     get(pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1255:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1260:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)'
 1260 |     get(const pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1260:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1265:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)'
 1265 |     get(const pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1265:5: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2445:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(tuple<_Elements ...>&)'
 2445 |     get(tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2445:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2451:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const tuple<_Elements ...>&)'
 2451 |     get(const tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2451:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2457:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(tuple<_Elements ...>&&)'
 2457 |     get(tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2457:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2466:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(const tuple<_Elements ...>&&)'
 2466 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2466:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:138:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(array<_Tp, _Nm>&)'
  138 |     get(array<_Tp, _Nm>&) noexcept;
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:138:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:142:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(array<_Tp, _Nm>&&)'
  142 |     get(array<_Tp, _Nm>&&) noexcept;
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:142:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:146:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const array<_Tp, _Nm>&)'
  146 |     get(const array<_Tp, _Nm>&) noexcept;
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:146:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:150:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)'
  150 |     get(const array<_Tp, _Nm>&&) noexcept;
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:150:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1272:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)'
 1272 |     get(pair<_Tp, _Up>& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1272:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1277:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_T1, _T2>&)'
 1277 |     get(const pair<_Tp, _Up>& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1277:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1282:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_T1, _T2>&&)'
 1282 |     get(pair<_Tp, _Up>&& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1282:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1287:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_T1, _T2>&&)'
 1287 |     get(const pair<_Tp, _Up>&& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1287:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1292:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_Up, _Tp>&)'
 1292 |     get(pair<_Up, _Tp>& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1292:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1297:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_Up, _Tp>&)'
 1297 |     get(const pair<_Up, _Tp>& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1297:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1302:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_Up, _Tp>&&)'
 1302 |     get(pair<_Up, _Tp>&& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1302:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_pair.h:1307:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_Up, _Tp>&&)'
 1307 |     get(const pair<_Up, _Tp>&& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1307:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2476:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&)' (deleted)
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
/usr/include/c++/14/tuple:2476:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2483:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(tuple<_Elements ...>&)'
 2483 |     get(tuple<_Types...>& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2483:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2494:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(tuple<_Elements ...>&&)'
 2494 |     get(tuple<_Types...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2494:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2505:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const tuple<_Elements ...>&)'
 2505 |     get(const tuple<_Types...>& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2505:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/tuple:2517:5: note: candidate: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const tuple<_Elements ...>&&)'
 2517 |     get(const tuple<_Types...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2517:5: note:   candidate expects 1 argument, 2 provided
a.cc: In function 'll power(ll, int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^