//////////////////////////////////////// // Problem : (WIP) // Time Complexity : O( M N^2 ) #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const ull MOD = 998244353; ull powm(ull a, ull i){ if(i == 0) return 1; ull r = powm(a*a%MOD,i/2); if(i % 2 == 1) r = r * a % MOD; return r; } ull solve(int N, int M, int K, vector A){ vector Pow2(N+1,1); for(int i=1; i<=N; i++) Pow2[i] = Pow2[i-1] * 2 % MOD; vector> Comb(N+1,vector(N+1,0)); rep(i,N+1){ Comb[i][0] = Comb[i][i] = 1; for(int j=1; j> dp(M+1,vector(N+1,0)); dp[0][N] = 1; rep(m,M){ for(int i=0; i<=N; i++) dp[m][i] = dp[m][i] * Pow2[N-i] % MOD; if(A[m] == 0){ for(int from=K; from<=N; from++){ for(int to=K; to<=from; to++){ dp[m+1][to] = (dp[m+1][to] + dp[m][from] * Comb[from][to]) % MOD; } } } else{ for(int from=K; from<=N; from++){ for(int to=0; to A; cin >> N >> M >> K; A.resize(M); rep(i,M){ char c; cin >> c; A[i] = c - '0'; } ull ans = solve(N,M,K,A); cout << ans << "\n"; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;