Educational Codeforces Round #105 ABCDE Solutions
A. ABC String Solution: Obviously, a certain letter appears twice as often as the other two letters. But for the convenience of implementation,…
A. ABC String Solution: Obviously, a certain letter appears twice as often as the other two letters. But for the convenience of implementation,…
Solution: It is obvious if the vertices can be repeated. Assuming there is a solution, there must be two edges v1->v2 and v2->v1.…
Solution: Sort the salary. We build a dynamic disjoint set. In the beginning, there only be n lower-level employees. And the father of these employees is empty.…
Solution: Classic binary search problem. We only consider the positive part. The negative part can be similar.…
Solution: First of all, if $k$ is not an even number, there must be no answer. Define $map[i][j][d]$ (where $0 \leq d <4$) represents the side length of $(i,j)$ in four directions.…
Solution: First of all, Base on ci−ci−1≤ci+1−ci and pi−pi−1≥pi+1−pi we can roughly found that:…
A. Sum of 2050 Solution: Obviously $n$ must be divisible by 2050. Then every decimal digit of $\frac n {2050}$ should be composed of the corresponding...…
Solution: First of all, "The product of every subarray is equal to its LCM" means "All these numbers are mutually prime". "All these numbers are mutually prime" means "In all these numbers, the prime factors of any two numbers are different".…