A. Cutting Banner
Keywords: [read title] [string] [enum]
Pit point: can only subtract a certain string of the remaining in the original order to make up the "codeforces", and reduce the next section of "Codeforces" is not possible
e.g. "codefAAAAorces" is feasible and "AAcodeforcesAA" is not feasible
B. Quasi Binary
Test instructions: Give a number n, for a minimum of several shapes such as "1010" so that only the number of ' 0 ' and ' 1 ' are added
Keywords: [greedy]
Solution: Because each bit of n is reduced by up to 1 at a time, the total number is the largest of all the bits of N. If a bit of n is not 0, it will be reduced by 1, 0 will be unchanged, leading 0 will be removed, which is the number required each time.
C. Tourist ' s Notes
Test instructions: A person to climb the mountain, known n days of a M-day mountain climbing height, and adjacent two days of height difference $\leq 1$, ask this person in this n days climb the highest height is how much, if contradiction output-1
Keywords: [Mathematical formula]
Solution: Obviously if the two adjacent days of height difference is greater than the time difference must be "impossible". The highest height must appear between two adjacent points of time. Set the adjacent two time points for $dx,dy (dx < DY) $, the height is $hx$, $hy $, when the highest point must be increased from $dx$ to the right, $dy $ left to increase the difference between the smallest point, set to $p (dx \leq P \leq dy) $. From $dx$ through $p$ days, $DX $ height $dpx = hx + p$, $dy $ height $dpy = hy + ((DY-DX)-p) $, $DPX = dpy$, Solution $p = (HY-HX+DY-DX)/2$, the highest height of this segment is $HX + p = (HY+HX-DY-DX)/2$, maintaining the m+1 segment (including tail)
D. Weird Chess
Test instructions
Codeforces Round #300