Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define Rep(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const int inf=1000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}
int main(){
  string s;cin>>s;
  int n=s.size();
  vi dp(n,vi(13));
  if(s[n-1]=='?')rep(i,10)dp[0][i]++;
  else dp[0][s[n-1]-'0']++;
  Rep(i,1,n){
    if(s[n-i-1]=='?'){
      rep(j,13){
        rep(k,10)dp[i][(j+k)%13]+=dp[i-1][j];
      }
    }
    else{
      rep(j,13)dp[i][(s[n-i-1]-'0'+j)%13]+=dp[i-1][j];
    }
  }
  cout<<dp[n-1][5]<<endl;
}


Compiler output:
a.cc:18:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void chmin(auto &a,auto b){if(b<a)a=b;}
      |            ^~~~
a.cc:18:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   18 | void chmin(auto &a,auto b){if(b<a)a=b;}
      |                    ^~~~
a.cc:19:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   19 | void chmax(auto &a,auto b){if(a<b)a=b;}
      |            ^~~~
a.cc:19:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   19 | void chmax(auto &a,auto b){if(a<b)a=b;}
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:23:17: error: no matching function for call to 'std::__debug::vector<long long int, std::allocator<long long int> >::vector(int&, vi)'
   23 |   vi dp(n,vi(13));
      |                 ^
In file included from /usr/include/c++/14/vector:76,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:2:
/usr/include/c++/14/debug/vector:212:9: note: candidate: 'template<class _InputIterator, class> std::__debug::vector<_Tp, _Allocator>::vector(_InputIterator, _InputIterator, const _Allocator&) [with <template-parameter-2-2> = _InputIterator; _Tp = long long int; _Allocator = std::allocator<long long int>]'
  212 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/debug/vector:212:9: note:   template argument deduction/substitution failed:
a.cc:23:17: note:   deduced conflicting types for parameter '_InputIterator' ('int' and 'std::__debug::vector<long long int, std::allocator<long long int> >')
   23 |   vi dp(n,vi(13));
      |                 ^
/usr/include/c++/14/debug/vector:250:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(_Base_ref) [with _Tp = long long int; _Allocator = std::allocator<long long int>]'
  250 |       vector(_Base_ref __x)
      |       ^~~~~~
/usr/include/c++/14/debug/vector:250:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/debug/vector:241:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = long long int; _Allocator = std::allocator<long long int>; allocator_type = std::allocator<long long int>]'
  241 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/14/debug/vector:241:43: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<long long int>'
  241 |       vector(initializer_list<value_type> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/debug/vector:232:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(std::__debug::vector<_Tp, _Allocator>&&, std::__type_identity_t<_Alloc>&) [with _Tp = long long int; _Allocator = std::allocator<long long int>; std::__type_identity_t<_Alloc> = std::allocator<long long int>]'
  232 |       vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/debug/vector:232:23: note:   no known conversion for argument 1 from 'int' to 'std::__debug::vector<long long int, std::allocator<long long int> >&&'
  232 |       vector(vector&& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~^~~
/usr/include/c++/14/debug/vector:228:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(const std::__debug::vector<_Tp, _Allocator>&, std::__type_identity_t<_Alloc>&) [with _Tp = long long int; _Allocator = std::allocator<long long int>; std::__type_identity_t<_Alloc> = std::allocator<long long int>]'
  228 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/debug/vector:228:28: note:   no known conversion for argument 1 from 'int' to 'const std::__debug::vector<long long int, std::allocator<long long int> >&'
  228 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/debug/vector:225:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(std::__debug::vector<_Tp, _Allocator>&&) [with _Tp = long long int; _Allocator = std::allocator<long long int>]'
  225 |       vector(vector&&) = default;
      |       ^~~~~~
/usr/include/c++/14/debug/vector:225:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/debug/vector:224:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(const std::__debug::vector<_Tp, _Allocator>&) [with _Tp = long long int; _Allocator = std::allocator<long long int>]'
  224 |       vector(const vector&) = default;
      |       ^~~~~~
/usr/include/c++/14/debug/vector:224:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/debug/vector:195:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(size_type, std::__type_identity_t<_Alloc>&, const _Allocator&) [with _Tp = long long int; _Allocator = std::allocator<long long int>; size_type = long unsigned int; std::__type_identity_t<_Alloc> = long long int]'
  195 |       vector(size_type __n, const __type_identity_t<_Tp>& __value,
      |       ^~~~~~
/usr/include/c++/14/debug/vector:195:59: note:   no known conversion for argument 2 from 'vi' {aka 'std::__debug::vector<long long int, std::allocator<long long int> >'} to 'std::__type_identity_t<long long int>&' {aka 'const long long int&'}
  195 |       vector(size_type __n, const __type_identity_t<_Tp>& __value,
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/debug/vector:191:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(size_type, const _Allocator&) [with _Tp = long long int; _Allocator = std::allocator<long long int>; size_type = long unsigned int]'
  191 |       vector(size_type __n, const _Allocator& __a = _Allocator())
      |       ^~~~~~
/usr/include/c++/14/debug/vector:191:47: note:   no known conversion for argument 2 from 'vi' {aka 'std::__debug::vector<long long int, std::allocator<long long int> >'} to 'const std::allocator<long long int>&'
  191 |       vector(size_type __n, const _Allocator& __a = _Allocator())
      |                             ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/debug/vector:185:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector(const _Allocator&) [with _Tp = long long int; _Allocator = std::allocator<long long int>]'
  185 |       vector(const _Allocator& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/debug/vector:185:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/debug/vector:180:7: note: candidate: 'std::__debug::vector<_Tp, _Allocator>::vector() [with _Tp = long long int; _Allocator = std::allocator<long long int>]'
  180 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/debug/vector:180:7: note:   candidate expects 0 arguments, 2 provided
a.cc:24:32: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[long long int]' for array subscript
   24 |   if(s[n-1]=='?')rep(i,10)dp[0][i]++;
      |                                ^
a.cc:25:13: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript
   25 |   else dp[0][s[n-1]-'0']++;
      |             ^
a.cc:29:23: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[long long int]' for array subscript
   29 |         rep(k,10)dp[i][(j+k)%13]+=dp[i-1][j];
      |                       ^
a.cc:29:42: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[long long int]' for array subscript
   29 |         rep(k,10)dp[i][(j+k)%13]+=dp[i-1][j];
      |                                          ^
a.cc:33:21: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[long long int]' for array subscript
   33 |       rep(j,13)dp[i][(s[n-i-1]-'0'+j)%13]+=dp[i-1][j];
      |                     ^
a.cc:33:51: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[long long int]' for array subscript
   33 |       rep(j,13)dp[i][(s[n-i-1]-'0'+j)%13]+=dp[i-1][j];
      |                                                   ^
a.cc:36:16: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}[int]' for array subscript
   36 |   cout<<dp[n-1][5]<<endl;
      |                ^