My solution for Round #310 (Div 1) C and D (555C, 555D)

Revision en1, by microtony, 2015-06-28 05:35:52

# 555C - Case of Chocolate

Initially there is only one single piece of chocolate. It is the problem's requirement that subsequent same coordinates should return 0 so we can use a set to store those coordinates. (For example, the sample two has two 10 1 so the second 10 1 should return 0.

Continuing the concept of pieces, observe that after one valid operation, the chocolate would be split into two (possibly zero area) pieces. For example, in the second sample, the first operation splits the chocolate into x = [1, 1] and x = [3, 10]

#### History

Revisions

Rev. Lang. By When Δ Comment
en11 microtony 2015-06-28 09:38:43 47 Tiny change: 'ution in $lg\ n\ \text' -> 'ution in$\text{lg}\ n\ \text'
en10 microtony 2015-06-28 06:35:32 0 (published)
en9 microtony 2015-06-28 06:34:57 30
en8 microtony 2015-06-28 06:34:02 2 Tiny change: '$peg_1 = 1 and peg_2 = 2$' -> '$peg_1 = 1$ and $peg_2 = 2$'
en7 microtony 2015-06-28 06:31:59 1027
en6 microtony 2015-06-28 06:17:06 96 Tiny change: '419da.png)' -> '419da.png)\n\n[problem:555C]\n=================='
en5 microtony 2015-06-28 06:14:25 61
en4 microtony 2015-06-28 06:13:25 56 Tiny change: 'orces.com/668842/555C2.png' -> 'orces.com/5649bc/555C2.png'
en3 microtony 2015-06-28 06:11:46 192
en2 microtony 2015-06-28 06:04:16 938
en1 microtony 2015-06-28 05:35:52 620 Initial revision (saved to drafts)