[Solution] Doremy's IQ Codeforces Solution
Doremy is asked to test contests. Contest can only be tested on day . The difficulty of contest is . Initially, Doremy's IQ is . On day Doremy will choose whether to test contest or not. She can only test a contest if her current IQ is strictly greater than .
If Doremy chooses to test contest on day , the following happens:
- if , Doremy will feel she is not wise enough, so decreases by ;
- otherwise, nothing changes.
Doremy wants to test as many contests as possible. Please give Doremy a solution.
The input consists of multiple test cases. The first line contains a single integer () — the number of test cases. The description of the test cases follows.
The first line contains two integers and (, ) — the number of contests and Doremy's IQ in the beginning.
The second line contains integers () — the difficulty of each contest.
Difference Operations Codeforces Solution
Difference of GCDs Codeforces Solution
Doremy's IQ Codeforces Solution
Difference Array Solution Codeforces
Partial Virtual Trees Codeforces Solution
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, you need to output a binary string , where if Doremy should choose to test contest , and otherwise. The number of ones in the string should be maximum possible, and she should never test a contest when her IQ is zero or less.
If there are multiple solutions, you may output any.
No comments:
Post a Comment