P3071 [USACO13JAN] Seating G
题目描述
To earn some extra money, the cows have opened a restaurant in their barn specializing in milkshakes. The restaurant has N seats (1
输入格式
\* Line 1: Two space-separated integers, N and M.
\* Lines 2..M+1: Each line describes a single event. It is either a line of the form "A p" (meaning a party of size p arrives) or "L a b" (meaning that all cows in the range [a, b] leave).
输出格式
\* Line 1: The number of parties that are turned away.
说明/提示
There are 10 seats, and 4 events. First, a party of 6 cows arrives. Then all cows in seats 2..4 depart. Next, a party of 5 arrives, followed by a party of 2.
Party #3 is turned away. All other parties are seated.