「CODEVS1050」棋盘染色 2

2014年1月31日4,5603

题目描述 Description

有一个5*N的棋盘,棋盘中的一些格子已经被染成了黑色,你的任务是对最少的格子染色,使得所有的黑色能连成一块。

输入描述 Input Description

第一行一个整数N(<=100),接下来N行每行一个长度为5的01串,1表示所在格子已经被染成了黑色,0表示所在格子没有被染色。

输出描述 Output Description

第一行一个整数N(<=100),接下来N行每行一个长度为5的01串,1表示所在格子已经被染成了黑色,0表示所在格子没有被染色。

样例输入 Sample Input

5 11100 11000 10000 01111 11111

样例输出 Sample Output

1

代码

按照上一题迭代深搜果断T,六七十分貌似

状压不会写。。

avatar
3 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Flandre·Scarlet Recent comment authors
  Subscribe  
提醒
刘丁洢

另求一波codevs boss单挑战题解

刘丁洢

求填坑,装压啊…

Flandre·Scarlet

求补状压。。