• 2024-08-16H. Ksyusha and the Loaded Set
    H.KsyushaandtheLoadedSetKsyushadecidedtostartagamedevelopmentcompany.Tostandoutamongcompetitorsandachievesuccess,shedecidedtowriteherowngameengine.Theenginemustsupportasetinitiallyconsistingof$n$distinctintegers$a
  • 2024-07-21Ksyusha and Chinchilla
    赛时做法:考虑特殊元素,叶子,显然叶子要与其父亲合并,于是不难拓展出一个解法:对每一个节点,维护其度数以及包含的点的数量,队列里面放着当前图中度数为\(1\)的点,取出队首,将其与其父亲(也就是唯一与其相连的点)合并,如果合并之后包含点数大于\(3\),那么无解,否则的话将其父亲的度数减一,如果此