arc096_b: Static Sushi

Try any of the four possible options, so for each sushi, we need to calculate

  1. net gain at this point from the start clockwise, and max possible netgain seen so far

  2. net gain at this point form the start cclockwise, and max possible netgain seen so far

We can scan each point, and check all possible net gain + maxpossible negain seen so far from from the opposite direction

arc097_b: Equals

We can form pairs as disjoint sets, inside each set, see how many index values appear also as value itself

arc097_c: Sorted and Sorted

Hard problem for me!!!

The inversion number is the cardinality of inversion set. It is a common measure of the sortedness of a permutation[5] or sequence.

Standard comparison sorting algorithms can be adapted to compute the inversion number in time O(n log n)

From the constraints in the statement, at any moment, the set of placed balls must be of the form ”i black balls numbered 1 through i, and j white balls numbered 1 through j”, and use an O(n^2) dp to find the min inversion # = cost

agc024_b: Backfront

Find the longest consecutive increaseing subsequence at each index, and take the longest one

agc024_c: Sequence Growing Easy

  1. x1 = 0, and x(i + 1) - x(i) <= 1

  2. Compute the lowerbound for the operations, and claim that the lowerbound is achievable. I got stuck at the lowerbound part!!!

  3. The observation is that we need to compute # of different consecutive pairs, which is either 1, or X(i) contributed by each entry