摘要:
1 package main 2 3 import ( 4 "fmt" 5 "math" 6 ) 7 8 //判断第k行的某一列放置是否合法 9 func check(col []int, k int) int {10 for i := 0; i = 0; {26 for col[i] 0 {29 i++30 }31 if i == k {32 return col33 }34 }35 ... 阅读全文
摘要:
1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 type Graphic struct { 8 edges [][]int 9 colors int10 color []int11 flag int12 }13 14 func (g *Graphic) check(n int) int {15 nodes := len(g.edges[0])16 for i := 0; i 0 {18 return 019 }20 }21 return... 阅读全文