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

建议使用的浏览器:

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

5617:Jam's maze

题目描述
Jam got into a maze, he has to find a palindrome path from $(1,1)$ to $(N,N)$ to get out.
However he is not only thinking about how to get out of the maze,
but also counting the number of ways he can get out.

The maze a $N*N$ grid. On each cell is a uppercase letter.
Jam is at upper-left corner $(1,1)$ now, and the exit is at lower-right corner $(N,N)$.
Jam can only go down or go right.
Considering the number of palindrome path may be huge, you just need to output the number mod $5201314$.
输入解释
The first line is $T(1 \leq T \leq 10)$ means $T$ Case.
For each case:
The first line is $N(1 \leq N \leq 500)$ means the size of the maze.
Then $N$ lines follow, each line has $N$ uppercase letter.
输出解释
For each testcase, output the number of palindrome path mod $5201314$.
输入样例
1
4
ABCD
BEFE
CDEB
GCBA
输出样例
12

提示
there are 1 solutions is"ABCDCBA"
there are 1 solutions is"ABCGCBA"
there are 4 solutions is"ABEDEBA"
there are 6 solutions is"ABEFEBA"
来自杭电HDUOJ的附加信息
Recommend hujie

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

题目来源 BestCoder Round #70

源链接: HDU-5617

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

共提交 0

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