Codeforces Round #751 (Div. 2) ABCD Solutions (Java/C++)
A. Two Subsequences Solution: Obviously the string a will only have one letter. We only need to find the smallest letter in the original string. Code: Java C++…
A. Two Subsequences Solution: Obviously the string a will only have one letter. We only need to find the smallest letter in the original string. Code: Java C++…
Solution: First of all, because after reaching 0, there will be no slip. Therefore, we consider slip as part of the ability to jump.…
A. Luntik and Concerts It's easy to guess the result: just look at the parity of the total time. But the proof of this topic is still a bit interesting.…
Solution: Let's take k=3, n=10 as an example, consider the choice of [l1, r1], consider the following two choices: [4, 6] and [3, 5].…
Solution: Let me show the conclusion first. The conclusion is that if the total time is an even number, output 0, otherwise output 1.…
A. Elections Solution: Calculate the difference between the maximum number of votes of the other two people and add one. Code: Java C++…
Solution: D1. All are Same First, if all numbers are the same, then k can be any value. So we only need to consider the situation where there are different numbers.…
Solution: First of all, according to the description of the problem, we can know that the direction of the brackets does not affect the result at all. So naturally, we only need to consider the parity of different types of brackets.…