英语题目作业(14)

原题:

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)

翻译:

Mio参观ACGN博物馆

某天,Mio去参观ACGN博物馆,他打算给Ritsu买一些礼物。

我们保证博物馆在一个n*m的方格中,称为矩阵A,矩阵中每一个格子代表一个摊位,只卖礼物0或1.换句话说,n*m的矩阵A中的每个格子都被0或1填满。

在控制COVID-19的政策下,在参观路线上有一些限制。

我们定义了一个安全通道,从左上角(1,1)到右下角(n,m),如果你在(x,y),你只能参观到(x+1,y)或者(x,y+1).每一个拜访者只能通过安全通道参观博物馆,Mio也是。

如果有且只有至少一个经过的摊位不同,我们就认为这两条路是不一样的。Mio想知道有多少种不同的安全通道路线,这些安全通道路线经过多少0和1,0的数目至少p,1的数目至少q。

因为结果可能过大,所以你只需要输出结果模上998244353998244353的值。

输入:

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

接下来每n行包括m个分开的整数ai,j(0<=i,j<=1),代表矩阵A中数字。

输出:

输出一个整数,代表这个问题的答案模上998244353998244353的值。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值