# 在2D字节数组中查找矩形的数量

12
``````0000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000
0000001111111111111100000000000000000011111111111111100000000000000000
0000001111111111111100000000000000000011111111111111100000000000000000
0000001111111111111100000000000000000011111111111111100000000000000000
0000001111111111111100000000000000000011111111111111100000000000000000
0000000000000000000000000000000000000011111111111111100000000000000000
0000000000000000000000000000000000000011111111111111100000000000000000
0000000000011111100000000000000000000011111111111111100000000000000000
0000000000011111100000000000000000000011111111111111100000000000000000
0000000000011111100000000000000000000011111111111111100000000000000000
0000000000000000000000000000000000000011111111111111100000000000000000
0000000000000000000000000000000000000011111111111111100000000000000000
0000000000000111111000000000000000000011111111111111100000000000000000
0000000000000100001000000111111000000011111111111111100000000010000000
0000000000000100001000000111111000000000000000000000011000000000000000
0000000000000111111000000111111000000000000000000000011000000000000000
0000000000000000000000000000111111000000000000000000000000000000000000
0000000000000000000000000000111111000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000
``````

1

Cruncher 2014年

microbian

`1100\n1100\n0011\n0011`
Cruncher 2014年

1

microbian

1

2

### GolfScript，107个字符

``````.n?):L;'1'/{,}%{1\$+)}*;][]\{:A{{+}+[1L.~)-1]%&}+1\$\,.@^\[[[A]]+{|}*]+}/{.{L%}{%\$..&1\$,1\$,/*\$=}:C~\{L/}C&},,
``````

``````11
01
-
0

111
111
-
1

100
001
001
-
2

11100
10101
11100
-
1

101
010
101
-
5
``````

@PaulR该规则未写在问题中，从所有合理的定义来看，它们都是非常好的矩形-也许以后再添加。
2014年

Paul R

microbian

Paul R