Tag:A flower

  • The problem of planting flowers

    Time:2021-1-21

    Suppose you have a very long flowerbed, with some plots planted with flowers and some plots not. However, flowers can not be planted on adjacent plots, they will compete for water, and both will die. Given a flower bed (represented by an array containing 0 and 1, where 0 means no flowers are planted and […]

  • Luogu p6394

    Time:2020-12-17

    Synchronized on: https://www.luogu.com.cn/blog/viea/solution-p6394 porblemP6394It’s very similar to arranging flowers.(in fact, it’s an enhanced version) General idea:There are k trees. There are s under each treeiFor each flower, find the number of schemes whose sum is n.It can end under any tree In fact, the idea of DP and recursion is almost the same. Strictly speaking, […]

  • Honeybees collect honey

    Time:2020-7-10

    A flower has two states: open and close. Three bees collect honey when the flower is open and return to nest when the flower is closed. The above process is simulated by object-oriented technology and design pattern method. The output is as follows: Flower open Bee 1’s eating time! Bee 2’s eating time! Bee 3’s […]