| 记录编号 | 
        578034 | 
        评测结果 | 
        AAAAAAAAAAAAAAAAAAAAAAWWW | 
    
    
        | 题目名称 | 
        3292.[CSP 2019S]Emiya家今天的饭 | 
        最终得分 | 
        88 | 
            
    
    
        | 用户昵称 | 
         00000 | 
        是否通过 | 
        未通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        1.928 s  | 
    
    
        | 提交时间 | 
        2023-01-27 03:04:56 | 
        内存使用 | 
        26.79 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll p=998244353;
ll n,m,ans=1;
ll a[3000][3000],b[3000];
ll f[400],g[400];
int main(){
	freopen("2019meal.in","r",stdin);
	freopen("2019meal.out","w",stdout);
cin>>n>>m;
for(int q=1;q<=n;q++)
for(int w=1;w<=m;w++) cin>>a[q][w];
for(int q=1;q<=n;q++)
{
	for(int w=1;w<=m;w++)
	{
		b[q]+=a[q][w];
	}
	ans=ans*(b[q]+1)%p;b[q]%=p;
}
ans--;
for(int q=1;q<=m;q++)
{
	memset(f,0,sizeof(f));memset(g,0,sizeof(g));
	f[200]=1;
	for(int w=1;w<=n;w++)
	{
		memcpy(g,f,sizeof(g));
		for(int e=50;e<=350;e++)
		{
			g[e]+=f[e-1]*a[w][q]%p;g[e]%=p;
			g[e]+=f[e+1]*(b[w]-a[w][q])%p;g[e]%=p;
		}
		memcpy(f,g,sizeof(g));
		memset(g,0,sizeof(g));
	}
	for(int e=201;e<=350;e++) ans=(ans+p-f[e])%p;
}
cout<<ans;
return 0;
}