Codeforces Round # 582 (Div. 3) problem-solving record

D

  • The meaning of problems: given a sequence \ (A \) , each operation can be \ (a_i: = \ lfloor \ FRAC} {2} {a_i \ rfloor \) , obtained several operations least Q \ (K \) th the same \ (a_i \)
  • Thinking: Each \ (a_i \) are reduced to 0, and added to a process of change in the vector (the same size, the number of different variations), so that the number of each will produce \ (log (n) \) number , after operation of each enumeration Vector, seeking the first k terms and the sort (k if the item is not calculated), the smallest is the answer

E

  • Question is intended: to two lengths of string of s1 2, s2 (comprising only 'a', 'b', 'c'), so that you configured length \ (with 3N \) string, 'a', ' b ',' c 'occurs n times and all substring can not have s1, s2
  • Ideas: The answer must be a string "abc" is a permutation or repeated n times, according to the arranged order so that 'a', 'b', 'c' repeated n times, the answer to enumerate all the strings can then judge.

F

  • The meaning of problems: given two sequences \ (P, Q \) , allows you to construct a string of length n s, so that \ (S [P_i] \ S Le [P_ +. 1 {I}] \) , \ (S [Q_I] \ S Le [Q_ +. 1 {I}] \) , and the minimum k different lower case letter appears.
  • Ideas: We \ (\ le \) seen as a predecessor relationship, construct a directed graph, ran tarjan, a strong component must be a letter Unicom

G

  • Meaning of the questions: given a weighted trees and a series of inquiries, asked how many of the points, so that the maximum weight on the simple path does not exceed w.
  • Thinking: with disjoint-set to maintain each of the edge after the point is not greater than \ (W \) set can reach, from small to large side and inquiries, for each challenge, we operate on less than the query side, if the edge both ends \ (u, v \) is not a collection, be combined contribution of the answer to \ (\ binom {size [u ] + size [v]} {2} - \ binom {size [u] {2}} - \ {Binom size [V]} {2} \) (point within the set of pairwise mutually reachable)

Guess you like

Origin www.cnblogs.com/xxrlz/p/11442986.html