Toggle navigation
点码成金编程
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Home
=>
ProblemSet
=> 4.2-28:切水果
Problem1359--4.2-28:切水果
1359: 4.2-28:切水果
Time Limit:
1
Sec
Memory Limit:
128 MB
Submit:
0
Solved:
0
[
Submit
] [
Status
] [ Creator:
][ 参考程序 ]
Description
给出一个n*n的表格,表格元素是数字,相同的数字表示相同的水果,两个或以上相邻的水果可以一次性消除,(消除之后其他水果不会改变位置),问可以消除的方案数。
Input
第一行一个整数n,表示接下来将有一个n*n的表格
第二行到第n+1行,每行有n个数字使用空格分隔
Sample Input
Copy
6 1 1 2 2 2 2 1 3 2 1 1 2 2 2 2 2 2 3 3 2 3 3 1 1 2 2 2 2 3 1 2 3 2 3 2 2
Sample Output
Copy
6
Source/Category
算法
递归
DFS