每天一翻译之13

Mio visits ACGN Exhibition

 2000ms  262144K

描述:

One day, Mio visits an Animation Comic Game Novel (ACGN) Exhibition, and she would like to buy some presents for Ritsu.

We assure that the space of the exhibition is a n×mn×m grid, called the grid A, and each cell in the grid represents a stall, only selling present 00 or 11. In other words, every cell of the n×mn×m grid A is filled with 00 or 11.

Under the control policy for containing COVID−19, there are some restrictions on visiting route. We define a SAFE PATH as a path from the top left cell (1,1)(1,1), to the bottom right cell (n,m)(n,m), and if you are in the cell (x,y)(x,y), then you can only travel to the cells (x+1,y)(x+1,y) or (x,y+1)(x,y+1). Every visitor has to visit the exhibition through SAFE PATH, so does Mio.

The two paths are considered to be different if and only if at least one cell passed differs.Mio wonders how many different SAFE PATHs, which have some 0s and 1s, and the number of 00 is at least pp, the number of 11 is at least qq.

Since the answer may be too large, you only need to output the result modulo 998244353998244353.

输入:

The first line contains four integers, n,m,p,q(1≤n,m≤500,0≤p,q≤10000)n,m,p,q(1≤n,m≤500,0≤p,q≤10000).

Each of the next n lines contains m space separated integersAi,j(0≤Ai,j≤1)Ai,j(0≤Ai,j≤1), denoting the number in the cell (i,j)(i,j) of the grid AA.

输出:

Print a single integer, denoting the answer to the question, modulo 998244353998244353.

样例输入:

2 2 1 1
0 0
1 1

样例输出:

2

样例输入:

3 3 2 0
0 0 1
0 0 1
1 0 0

样例输出:

6

https://acs.jxnu.edu.cn/problem/ICPCJX2021A

一天,米欧参观了一个动漫游戏小说(ACGU)展览,她想给丽苏买些礼物。

我们保证展览的空间是一个n*m的网格,称为网格a,网格中的每个单元代表一个摊位,仅出售1或1分份礼物。换句话说,n*m网格A的每个单元都用0或1填充。

根据控制新型冠状病毒的政策,参观路线有一些限制。我们将安全路径定义为从左上角单元格(1,1)到右下角单元格(n,m)的路径,如果您在单元格(x,y)中,那么您只能前往单元格(x+1,y)或(x,y+1).每位参观者都必须通过安全通道参观展览,米欧也是。

当且仅当通过的至少一个单元不同时,这两条路劲被认为是不同的。米欧想知道有多少不同的安全路径,其中有0和1,0的数量至少是p,1的数量至少是q。

由于答案的可能太大,只需输出结果模998244353.

输入:

第一行包括4个整数,n,m,p,q(1<=n,m<<500,0<=p,q<=10000)

接下来的n行中每一行都包括m个空间分隔的整数ai,j(0<=ai,j<=1),表示网格A的单元格(i,j)中的数字。

输出:

输出一个整数,表示问题的答案,模为998244353.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值