当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5465:Clarke and puzzle

题目描述
Clarke is a patient with multiple personality disorder. One day, Clarke split into two personality $a$ and $b$, they are playing a game.
There is a $n*m$ matrix, each grid of this matrix has a number $c_{i, j}$.
$a$ wants to beat $b$ every time, so $a$ ask you for a help.
There are $q$ operations, each of them is belonging to one of the following two types:
1. They play the game on a $(x_1, y_1)-(x_2, y_2)$ sub matrix. They take turns operating. On any turn, the player can choose a grid which has a positive integer from the sub matrix and decrease it by a positive integer which less than or equal this grid's number. The player who can't operate is loser. $a$ always operate first, he wants to know if he can win this game.
2. Change $c_{i, j}$ to $b$.

输入解释
The first line contains a integer $T(1 \le T \le 5)$, the number of test cases.
For each test case:
The first line contains three integers $n, m, q(1 \le n, m \le 500, 1 \le q \le 2*10^5)$
Then $n*m$ matrix follow, the $i$ row $j$ column is a integer $c_{i, j}(0 \le c_{i, j} \le 10^9)$
Then $q$ lines follow, the first number is $opt$.
if $opt=1$, then $4$ integers $x_1, y_1, x_1, y_2(1 \le x_1 \le x_2 \le n, 1 \le y_1 \le y_2 \le m)$ follow, represent operation $1$.
if $opt=2$, then $3$ integers $i, j, b$ follow, represent operation $2$.
输出解释
For each testcase, for each operation $1$, print $Yes$ if $a$ can win this game, otherwise print $No$.
输入样例
1
1 2 3
1 2
1 1 1 1 2
2 1 2 1
1 1 1 1 2
输出样例
Yes
No

Hint:
The first enquiry: $a$ can decrease grid $(1, 2)$'s number by $1$. No matter what $b$ operate next, there is always one grid with number $1$ remaining . So, $a$ wins.
The second enquiry: No matter what $a$ operate, there is always one grid with number $1$ remaining. So, $b$ wins.
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5465

最后修改于 2020-10-25T23:22:54+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)