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

建议使用的浏览器:

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

3334:Matrix Puzzle

题目描述
As you know, math is quite incredible.For example,if you want to know all x that not only satisfy the expression A^x = B ( mod C) where A,B and C are given and C is a prime number, but also smaller than C, you could use the following algorithm
(http://en.wikipedia.org/wiki/Baby-step_giant-step).
Now your task is quite simple. You are given A,B, here A and B are matrixes( n X n).You are expected to solve the following expression.
mod 1000000007
输入解释
There are no more than 20 cases.
For each case,there are two integers n,L in the first line indicating the size of the matrixes , the value of L. (Here 1<= n <= 50, 1<= L <= 10^11)
Then follows 2n lines.
For the first n lines, indicating the matrix A.
For the next n lines, indicating the matrix B.
All the numbers in the matrix are between 0 and 10^9
输出解释
Output a single line with “Case #idx: ”,here idx is the case number start from 1. Then output if there is only one valid solution (the solution must no larger than L and larger than 0).
If there is only one valid solution ,then just output “Yes”, otherwise output “No”.
We assure that the ABS(|A|) (determinant’s abosolute value)is always larger than one after the mod operation in all the cases.
输入样例
1 6
2
2

1 4
2
1

2 3
1 2
2 1
5 4
4 5
输出样例
Case 1: Yes
Case 2: No
Case 3: Yes
来自杭电HDUOJ的附加信息
Author AekdyCoin@FZU
Recommend lcy

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

源链接: HDU-3334

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

共提交 0

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