Official

C - Slot Strategy 2 (Easy) Editorial by en_translator


For a fixed digit to let the reels show, and the order of reels to stop, it is optimal to stop a reel for the first time when the desired digit is displayed. The minimum duration required for this case can be found in an \(O(M)\) time by actually simulating.

Therefore, the answer is the minimum value of the durations required among ten choices of the desired digit and six orders of stopping reels, for a total of 60 cases.

Writer’s solution (Python)

posted:
last update: