Codeforces Round #752 (Div. 2) ABCDE Solutions (Java/C++)
A. Era Solution: Just simulation. When we find a certain a[i]>i+ ans, insert the number of a[i]-(i+ ans). Code: Java C++…
A. Era Solution: Just simulation. When we find a certain a[i]>i+ ans, insert the number of a[i]-(i+ ans). Code: Java C++…
Solution: Obviously, we don't need to consider the operation sequence. Therefore, we directly consider how to perform several operations on a certain number.…
A. Linear Keyboard Solution: Just simulate according to the question. Code: Java C++…
Solution: Obviously, if two dishes are the same, then the total weight of the two dishes must also be the same. According to the previous question, we know that we can calculate the value range of the last remaining a.…
Solution: We represent the total remain weight of each dish by $remain_i$, which obviously has $remain_i=a_i+b_i-m$.…
Solution: Obviously it is a memory search. Obviously, the maximum distance that the current point can travel = the maximum distance of the next point+1.…
A. AB Balance Solution: Obviously, if the beginning and ending letters are the same letter, AB(s) must be equal to BA(s). Code: Java C++…
Solution: Based on the size of the data, we can almost infer that the final complexity should be $n\cdot x$.…