Remember a magical codeforces

  Today there was a codeforces of div3, very appropriate time, so wanted to play. It was found that rating over 1600 can not apply. Although shzr a long time without a fight CF and vegetables, but after all, to 1600, and then ZUTTER_ together with the original of a trumpet: wzxakioi participated in the competition;

  However div3 is really simple, although the network very slow, but eventually AK, looking for a numerical rating plug forget about this game can be found on the 254 ... ??? than my large are high ...

  A: very simple, sweep again, we need to change on a whim, gone;

  B: descending, obviously the best, if not assured, it will use the exchange forensics is also OK;

  C: meaning of the questions a little fuzzy, but in fact refers to the general coverage, what do not control, "not strictly in it" just fine. Count the black area covered and, if it is not equal to white, otherwise you can;

  D: a first row sequence, meaning of the questions can be $ a_1 + b_1z = a_2 + b_2z = ... = a_n + b_nz $, $ considered lost $ A_1, the whole divided by the equation Z $ $, $ a_i-a_1 found $ $ z $ must be a multiple, while the larger $ z $, $ Y $ smaller, so to take a $ z $ $ $ $ GCD for all $ a_i-a_1 enough. Then you will find $ b_1 \ geq b_2 \ geq ... \ geq b_n $, and just make sure a $ b_i $, the other would have to determine, because you want to minimize the $ \ sum b_i $ located directly $ b_n = 0 $ on it;

  E: first-half, to find the end of the last full paragraph; another half, to find the last a whole number; the final output the correct position;

  F: two transfer: $ dp [i] = dp [i-1] + i $; $ I $ if this location can put the router, then the $ dp [k] = dp [ \ max (0, ik-1 )] + i, k \ in [\ max (1, ik), max (i + k, n)] $, these two operations can be easily realized by segment tree.

--- shzr

Guess you like

Origin www.cnblogs.com/shzr/p/11563813.html