[Solution] Mark the Dust Sweeper Codeforces Solution
Mark is cleaning a row of rooms. The -th room has a nonnegative dust level . He has a magical cleaning machine that can do the following three-step operation.
- Select two indices such that the dust levels , , , are all strictly greater than .
- Set to .
- Set to .
The first line contains a single integer () — the number of test cases.
The first line of each test case contains a single integer () — the number of rooms.
Mark and the Online Exam Codeforces Solution
Mark and Professor Koro Codeforces Solution
Mark and Lightbulbs Codeforces Solution
Mark and His Unfinished Essay Codeforces Solution
Mark the Dust Sweeper Codeforces Solution
Mark the Photographer Codeforces Solution
The second line of each test case contains integers , , ..., () — the dust level of each room.
It is guaranteed that the sum of across all test cases does not exceed .
For each test case, print a line containing a single integer — the minimum number of operations. It can be proven that there is a sequence of operations that meets the goal.
No comments:
Post a Comment