Codeforces Round #763 ABC Solutions (Java/C++)
A. Robot Cleaner Solution: Just simulate the behavior of the robot according to the requirements of the problem. Code: Java C++…
A. Robot Cleaner Solution: Just simulate the behavior of the robot according to the requirements of the problem. Code: Java C++…
A. Square String? Solution: First, see whether the length of the string can be divisible by 2, and then verify whether the first half and the second half are the same.…
A. Forbidden Subsequence Solution: You can sort the strings directly, that is, you can directly output the string in the form of aaaabbbbccccdefg.…
A. Polycarp and Sums of Subsequences Solution: We assume a[1]
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):…
A. Life of a Flower Solution: Just simulate according to the description of the problem. Code: 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++…
Solution: First of all, we need to notice that after the domino is painted, there are actually only 4 states: BW, WB, WW, BB.…