Language: C++

#include<bits/stdc++.h>
using namsespace std;
int dp[10002][102][2];
int mod=1000000007;
int d;
int get(vector<int>& v,int i,int f,int sum)
{
   if(i==v.size())
   {
     if(sum%d==0)
     return 1;
     else
       return 0;
     
   }
  int ans=dp[i][sum][d];
  if(dp[i][sum][d]!=-1) return ans;
  ans=0;
  
   int l=(f)? v[i]:9;
    for(int k=0;k<=l;k++)
    {
      int f1=f & (k==l);
      
      ans=((long long)ans+get(v,i+1,f1,(sum+i)%d))%mod;
     
    }
  
    return ans;
  
  
  
}


int main()
{
  int n;
  cin>>n>>d;
  vector<int> v;
  while(n)
  {
    v.push_back(n%10);
    n=n/10;
    
  }
  reverse(v.begin(),v.end());
  memset(dp,-1,sizeof(dp));
  
  int ans=get(v,0,1,0);
  cout<<(ans-1+mod)%mod<<endl: 
  
  
  
  
  
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namsespace'
    2 | using namsespace std;
      |       ^~~~~~~~~~
a.cc:6:9: error: 'vector' was not declared in this scope
    6 | int get(vector<int>& v,int i,int f,int sum)
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:16: error: expected primary-expression before 'int'
    6 | int get(vector<int>& v,int i,int f,int sum)
      |                ^~~
a.cc:6:24: error: expected primary-expression before 'int'
    6 | int get(vector<int>& v,int i,int f,int sum)
      |                        ^~~
a.cc:6:30: error: expected primary-expression before 'int'
    6 | int get(vector<int>& v,int i,int f,int sum)
      |                              ^~~
a.cc:6:36: error: expected primary-expression before 'int'
    6 | int get(vector<int>& v,int i,int f,int sum)
      |                                    ^~~
a.cc:6:43: error: expression list treated as compound expression in initializer [-fpermissive]
    6 | int get(vector<int>& v,int i,int f,int sum)
      |                                           ^
a.cc: In function 'int main()':
a.cc:39:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   39 |   cin>>n>>d;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:40:3: error: 'vector' was not declared in this scope
   40 |   vector<int> v;
      |   ^~~~~~
a.cc:40:3: note: suggested alternatives:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:40:10: error: expected primary-expression before 'int'
   40 |   vector<int> v;
      |          ^~~
a.cc:43:5: error: 'v' was not declared in this scope
   43 |     v.push_back(n%10);
      |     ^
a.cc:47:11: error: 'v' was not declared in this scope
   47 |   reverse(v.begin(),v.end());
      |           ^
a.cc:47:3: error: 'reverse' was not declared in this scope; did you mean 'std::reverse'?
   47 |   reverse(v.begin(),v.end());
      |   ^~~~~~~
      |   std::reverse
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: 'std::reverse' declared here
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
a.cc:50:14: error: 'get' cannot be used as a function
   50 |   int ans=get(v,0,1,0);
      |           ~~~^~~~~~~~~
a.cc:51:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   51 |   cout<<(ans-1+mod)%mod<<endl:
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:51:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   51 |   cout<<(ans-1+mod)%mod<<endl:
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~