This post is all about the solution of the "A - Seat Occupation" AtCoder Regular Contest 152 Problem Solution.
Problem Statement :
There is a row of L-shaped chairs. Now, N groups of individuals will arrive and take their seats in the correct order. Evey group is made up of one or two people, and the i-th group is made up of an I people. L is the total number of individuals.
Evey group will randomly pick and take up unoccupied chairs where all group members can sit consecutively. If there aren't enough successive uninhabited seats, they'll leave without seated themselves.
Determine if it is assured that all N groups will be able to sit.
Format of Input :
Format of the Output :
If it is certain that all N groups will be able to sit, print Yes; or else, print No.
0 Comments