Language: C++

#include<bits/stdc++.h>

using namespace std;
int n,m,a[N+5],f[N+5][N+5][N+5];char s[N+5];
int main()
{
	RI i,j,k,cnt=1;for(scanf("%s",s+1),n=strlen(s+1),i=1;i<=n;++i) s[i]^'0'?++a[cnt]:++cnt;//转化
	RI p;scanf("%d",&m),m=min(n,m),f[0][0][0]=1;//初始化
	for(i=0;i^cnt;++i) for(j=0;j<=m;++j) for(k=0;k<=m;++k) if(f[i][j][k])//枚举状态，如果状态能达到再去刷表
	{
		Inc(f[i+1][j][k],f[i][j][k]);//不操作
		for(p=m-j;p;--p) Inc(f[i+1][j+p][k+p],f[i][j][k]);//加上一个数
		for(p=min(a[i+1],k);p;--p) Inc(f[i+1][j][k-p],f[i][j][k]);//减去一个数
	}
	RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
}

Compiler output:
a.cc:4:11: error: 'N' was not declared in this scope
    4 | int n,m,a[N+5],f[N+5][N+5][N+5];char s[N+5];
      |           ^
a.cc:4:18: error: 'N' was not declared in this scope
    4 | int n,m,a[N+5],f[N+5][N+5][N+5];char s[N+5];
      |                  ^
a.cc:4:23: error: 'N' was not declared in this scope
    4 | int n,m,a[N+5],f[N+5][N+5][N+5];char s[N+5];
      |                       ^
a.cc:4:28: error: 'N' was not declared in this scope
    4 | int n,m,a[N+5],f[N+5][N+5][N+5];char s[N+5];
      |                            ^
a.cc:4:40: error: 'N' was not declared in this scope
    4 | int n,m,a[N+5],f[N+5][N+5][N+5];char s[N+5];
      |                                        ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'RI' was not declared in this scope
    7 |         RI i,j,k,cnt=1;for(scanf("%s",s+1),n=strlen(s+1),i=1;i<=n;++i) s[i]^'0'?++a[cnt]:++cnt;//转化
      |         ^~
a.cc:7:39: error: 's' was not declared in this scope
    7 |         RI i,j,k,cnt=1;for(scanf("%s",s+1),n=strlen(s+1),i=1;i<=n;++i) s[i]^'0'?++a[cnt]:++cnt;//转化
      |                                       ^
a.cc:7:58: error: 'i' was not declared in this scope
    7 |         RI i,j,k,cnt=1;for(scanf("%s",s+1),n=strlen(s+1),i=1;i<=n;++i) s[i]^'0'?++a[cnt]:++cnt;//转化
      |                                                          ^
a.cc:7:83: error: 'a' was not declared in this scope
    7 |         RI i,j,k,cnt=1;for(scanf("%s",s+1),n=strlen(s+1),i=1;i<=n;++i) s[i]^'0'?++a[cnt]:++cnt;//转化
      |                                                                                   ^
a.cc:7:85: error: 'cnt' was not declared in this scope; did you mean 'int'?
    7 |         RI i,j,k,cnt=1;for(scanf("%s",s+1),n=strlen(s+1),i=1;i<=n;++i) s[i]^'0'?++a[cnt]:++cnt;//转化
      |                                                                                     ^~~
      |                                                                                     int
a.cc:8:11: error: expected ';' before 'p'
    8 |         RI p;scanf("%d",&m),m=min(n,m),f[0][0][0]=1;//初始化
      |           ^~
      |           ;
a.cc:8:40: error: 'f' was not declared in this scope
    8 |         RI p;scanf("%d",&m),m=min(n,m),f[0][0][0]=1;//初始化
      |                                        ^
a.cc:9:13: error: 'i' was not declared in this scope
    9 |         for(i=0;i^cnt;++i) for(j=0;j<=m;++j) for(k=0;k<=m;++k) if(f[i][j][k])//枚举状态，如果状态能达到再去刷表
      |             ^
a.cc:9:19: error: 'cnt' was not declared in this scope; did you mean 'int'?
    9 |         for(i=0;i^cnt;++i) for(j=0;j<=m;++j) for(k=0;k<=m;++k) if(f[i][j][k])//枚举状态，如果状态能达到再去刷表
      |                   ^~~
      |                   int
a.cc:9:32: error: 'j' was not declared in this scope
    9 |         for(i=0;i^cnt;++i) for(j=0;j<=m;++j) for(k=0;k<=m;++k) if(f[i][j][k])//枚举状态，如果状态能达到再去刷表
      |                                ^
a.cc:9:50: error: 'k' was not declared in this scope
    9 |         for(i=0;i^cnt;++i) for(j=0;j<=m;++j) for(k=0;k<=m;++k) if(f[i][j][k])//枚举状态，如果状态能达到再去刷表
      |                                                  ^
a.cc:11:17: error: 'Inc' was not declared in this scope
   11 |                 Inc(f[i+1][j][k],f[i][j][k]);//不操作
      |                 ^~~
a.cc:12:21: error: 'p' was not declared in this scope
   12 |                 for(p=m-j;p;--p) Inc(f[i+1][j+p][k+p],f[i][j][k]);//加上一个数
      |                     ^
a.cc:13:21: error: 'p' was not declared in this scope
   13 |                 for(p=min(a[i+1],k);p;--p) Inc(f[i+1][j][k-p],f[i][j][k]);//减去一个数
      |                     ^
a.cc:13:27: error: 'a' was not declared in this scope
   13 |                 for(p=min(a[i+1],k);p;--p) Inc(f[i+1][j][k-p],f[i][j][k]);//减去一个数
      |                           ^
a.cc:15:11: error: expected ';' before 't'
   15 |         RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
      |           ^~
      |           ;
a.cc:15:20: error: 'i' was not declared in this scope
   15 |         RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
      |                    ^
a.cc:15:38: error: 't' was not declared in this scope; did you mean 'tm'?
   15 |         RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
      |                                      ^
      |                                      tm
a.cc:15:42: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |         RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
      |                                          ^~~
      |                                          int
a.cc:15:34: error: 'Inc' was not declared in this scope
   15 |         RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
      |                                  ^~~
a.cc:15:75: error: 't' was not declared in this scope; did you mean 'tm'?
   15 |         RI t=0;for(i=0;i<=m;++i) Inc(t,f[cnt][i][0]);return printf("%d\n",t),0;//输出答案
      |                                                                           ^
      |                                                                           tm