//g++ 2.cpp -std=c++14 -O2 -I . #include using namespace std; #include using namespace atcoder; using ll = long long; using ld = long double; using vi = vector; using vvi = vector; using vll = vector; using vvll = vector; using vld = vector; using vvld = vector; #define fi first #define se second #define pb push_back #define pq_big(T) priority_queue,less> #define pq_small(T) priority_queue,greater> #define all(a) a.begin(),a.end() #define rep(i,start,end) for(ll i=start;i<(ll)(end);i++) #define per(i,start,end) for(ll i=start;i>=(ll)(end);i--) #define uniq(a) sort(all(a));a.erase(unique(all(a)),a.end()) const int MAX=510000; const long long MOD=998244353; long long fac[MAX],finv[MAX],inv[MAX],pow2[MAX]; void COMinit(){ fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i,int> seen; map,ll> value; ll solve(int n,int m,int k,string x){ if(x==""){ return 1; } if(seen[{n,m}]==true){ return value[{n,m}]; } string next=x.substr(1); ll res=0; if(x[0]=='0'){ //0 k個以上必要 rep(i,k,n+1){ //0をi個置く場合 ll com=COM(n,i); com*=pow_mod(pow2[m-1],n-i,mod); com%=mod; com*=solve(i,m-1,k,next); res=(res+com)%mod; } } else{ //0 k個未満必要 rep(i,0,k){ //0をi個置く場合 ll com=COM(n,i); com*=solve(n,m-1,k,next); res=(res+com)%mod; } } seen[{n,m}]=true; value[{n,m}]=res; return res; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); COMinit(); pow2[0]=1; rep(i,1,MAX){ pow2[i]=pow2[i-1]*2; pow2[i]%=mod; } int n,m,k; cin>>n>>m>>k; string x; cin>>x; cout<