曹文信息在线OJ
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
Login
Register
1325: 【回溯】填色问题
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:45
Solved:1
Submit
Submit Record
Statistics
Web Board
ShowOff!
Description
有一张包含N(N≤10)
块区域的地图,给出
M(M≤50)
个描述,每组描述
A,B表示A,B相邻,相邻的区域
不能染同一种颜色,一种有四种颜色,请你用这四种颜色给地图染色,一共有多少中染色方法?
Input
第一行两个数N和M
接下来M行,每行一组数A,B表示A,B相邻
Output
一
个数表示染色方法数
Sample Input
Copy
5 4 1 2 1 3 1 4 1 5
Sample Output
Copy
324
Source/Category
高级B