Painter Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 895 Accepted Submission(s): 408 Problem Description Mr. Hdu is an painter, as we all know, painters need ideas to innovate , one day,…
Painter 题意:有一个棋盘n行,列数不超过50,用red和blue给这个棋盘涂色,每个格子每种颜色最多涂一次,如果两种颜色都涂了则该格子颜色为Green;red以斜杠'\'方式涂色,bule以'/'方式涂色.给出涂色后的棋盘,问最少涂了几次. 思路:搜索的思路没错,不过这题有点小坑,题目只告诉了行,并没有明确列,所以得自己求出.涂色时并不是一涂到底,也可以连续几个对角的格子涂色.所以不管是暴力枚举还是搜索都行. const int N=100+5; char s[N][N]; int n,…