Search
line_size(r,c,data)
zadání
line_column_size(r , c, data)
region_size(r , c, data)
r=5 c=5 data = [ [0, 1, 1, 1, 1, 0, 0, 0 ] , [1, 1, 0, 1, 0, 1, 1, 1 ] , [0, 1, 1, 0, 0, 1, 0, 1 ] , [1, 1, 1, 0, 1, 1, 0, 1 ] , [0, 1, 0, 0, 0, 0, 1, 1 ] , [1, 0, 1, 1, 0, 0, 0, 0 ] , [0, 1, 1, 1, 0, 1, 1, 1 ] , [1, 1, 0, 1, 0, 1, 1, 1 ]] reg_size = line_column_size(r , c, data) print(reg_size) 5
r=2 c=6 data = [ [1, 0, 0, 0, 1, 1, 0, 0 ] , [1, 1, 1, 0, 0, 1, 1, 1 ] , [0, 1, 0, 0, 1, 1, 1, 1 ] , [0, 1, 0, 1, 0, 1, 1, 1 ] , [0, 1, 1, 0, 0, 0, 1, 1 ] , [1, 0, 0, 0, 1, 1, 0, 0 ] , [0, 0, 1, 0, 1, 1, 1, 0 ] , [0, 0, 1, 0, 1, 0, 1, 0 ]] reg_size = region_size(r , c, data) print(reg_size) 12