Codeforces Round #761 ABCD solutions (Java/C++)

A. Forbidden Subsequence Solution: You can sort the strings directly, that is, you can directly output the string in the form of aaaabbbbccccdefg.…

Codeforces Round #760 ABCDEFG Solutions (Java/C++)

A. Polycarp and Sums of Subsequences Solution: We assume a[1]<a[2]<a[3]. So naturally b[7]=a[1]+a[2]+a[3], b[6]=a[2]+a[3], b[5]=a[1]+a[3].…

Codeforces Round #760 Trader Problem Solution (Java/C++)

Solution: First, we can directly consider all items together. Let's consider the following example (I modified it a little bit based on the sample data):…

Codeforces Round #759 ABCD Solutions (Java/C++)

A. Life of a Flower Solution: Just simulate according to the description of the problem. Code: Java C++…

Codeforces Round #758 ABCD Solutions (Java/C++)

A. Find Array Solution: Obviously, when x>0, x cannot be divisible by x+1. Therefore, we can set a[i]=a[i-1]+1. Code: Java C++…

Codeforces Round #758 Dominoes Solution (Java/C++)

Solution: First of all, we need to notice that after the domino is painted, there are actually only 4 states: BW, WB, WW, BB.…

Educational Codeforces Round 118 ABCDE Solutions (Java/C++)

A. Long Comparison Solution: First, we can compare the digits of x. If the digits are different, we will continue to multiply the number with less digits by 10 until the digits are the same.…

Educational Codeforces Round 118 MEX Sequences Solution (Java/C++)

Solution: First, we consider what options are available to meet the conditions. Obviously [0, 1, 2, 3, 4, 5] is eligible, because for any i, x[i]-MEX(x[1],..., x[i])=-1.…