JAlgoArena icon indicating copy to clipboard operation
JAlgoArena copied to clipboard

"Chocolate Bars" - specification slightly underdefined

Open pmarecki opened this issue 6 years ago • 2 comments

We are given a picture of example bars, and the cuts that lead to the preferred solution -- this is good. However, in order to code it, we'd like to get some info on how each bar is encoded in the int[][];

  • can we assume these matrices are rectangular?, or
  • could we please get the matrices that correspond to the two bars from the example? is, for instance the lower one, [1][1][1] [1] [1][1][1] given by {{1,1,1},{0,0,1},{1,1,1}? (Are empty places encoded by 0 or other char?)

pmarecki avatar Sep 25 '18 11:09 pmarecki

  • No, that's not correct assumption, after cut they may have different lengths (arrays in array)
  • [[[1],[1,1,1],[1]],[[1,1,1],[1],[1,1,1]]]

spolnik avatar Sep 25 '18 12:09 spolnik

ah -- OK -- now I see -- so these pieces come from one bar cut somehow; and the input for the first is "left justified" (so to say) and 2nd is "right justified" -- is it correct ?

(for we would have ambiguities if the two pieces were cut in a "w", "m" way... ) (I just want to understand the input data correctly)

pmarecki avatar Sep 25 '18 14:09 pmarecki