S

Revision en1, by KKOrange, 2023-04-05 14:35:18

Let's first establish the order we should buy the snacks. Suppose we want to buy a snack of type $$$i$$$ and a snack of type $$$j$$$ ($$$i < j$$$), which one should we buy first? Note that the total value of the snacks dispensed doesn't depend on the order we buy these two snacks. However, if there is only one snack of type $$$i$$$ we cannot buy snack $$$j$$$ first. So we can assume that snacks should be bought in non-descending order (i.e. from left to right).

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en12 English KKOrange 2023-04-06 07:47:28 13
en11 English KKOrange 2023-04-05 17:24:49 3
en10 English KKOrange 2023-04-05 17:24:25 0 (published)
en9 English KKOrange 2023-04-05 17:23:04 775
en8 English KKOrange 2023-04-05 17:14:10 1586 Tiny change: '_i$.\n\n![ ](/predow' -> '_i$.\n\n![Snacks ](/predow'
en7 English KKOrange 2023-04-05 16:58:53 69
en6 English KKOrange 2023-04-05 16:55:17 486
en5 English KKOrange 2023-04-05 16:47:12 73
en4 English KKOrange 2023-04-05 16:46:37 166
en3 English KKOrange 2023-04-05 16:44:26 481
en2 English KKOrange 2023-04-05 16:36:48 1852
en1 English KKOrange 2023-04-05 14:35:18 452 Initial revision (saved to drafts)